Issue
I tried to start jupyter notebook
the way I have been for a long time, and I get the following output:
$jupyter notebook
bash: /usr/local/bin/jupyter: /usr/local/opt/python/bin/python3.7: bad interpreter: No such file or directory
Upon inspiration from this I discovered that the file /usr/local/bin/jupyter
contained a path to /usr/local/opt/python/bin/python3.7
, which was a nonexistent file. So, I changed the path to the following /usr/local/bin/python3.10
at the first line of /usr/local/bin/jupyter
, so it looks like this:
#!/usr/local/bin/python3.10
import re
import sys
from jupyter_core.command import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
sys.exit(main())
This seemed like a promising solution to me. However, when I run jupyter notebook
again, I’m getting the following output:
Traceback (most recent call last):
File "/usr/local/bin/jupyter", line 5, in <module>
from jupyter_core.command import main
ModuleNotFoundError: No module named 'jupyter_core'
However, none of the solutions listed at https://github.com/jupyter/notebook/issues/3464 were able to resolve this for me.
Finally, I tried reinstall jupyter via pip3 install jupyter
, but it’s giving me a legacy install error for libxml2
(happy to share details on that if they’re relevant).
Am I missing an easier way to resolve this issue with jupyter notebook? Or do I need to modify this path in other files as well?
Solution
Uninstalling via brew, and overwriting the existing jupyter notebook files worked:
brew uninstall jupyter
brew link --overwrite jupyterlab
Still no resolution on why pip3 install jupyter
didn't work.
Answered By - makansij
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.