For some reason, when I pip3 everything, it goes all under this PATH /Users/XXX/Library/Python/3.8/bin
same for my notebook.
So I opened my vscode and go to .zshrc and add export PATH=$PATH:/Users/XXX/Library/Python/3.8/bin to my path.
And I go to terminal jupyter notebook I got zsh: /Users/XXX/Library/Python/3.8/bin/jupyter: bad interpreter: /usr/local/bin/python3: no such file or directory
And then I go back to .zshrc and change the path to export PATH=$PATH:/Users/XXX/Library/Python/3.8/bin/jupyter-notebook and I add to the path, it got zsh: command not found: jupyter
I refuse to use conda.. no particular reason.
What should I do next?
UPDATE
The actual reason I want to solve above issue is because I have my jupyter kernel running fine in my VS code, but cannot convert to HTML. That's why I thought install web-based Jupyter Notebook can help me solve this issue. Apparently, it did not. when I try to convert to HTML in web-based notebook, it give me the 500 Internal Error.
I also tried something like this python3 -m jupyter nbconvert --to html notebook.ipynb
And I got the following error:
Traceback (most recent call last):
File "/Users/zhengyangzhang/Library/Python/3.8/lib/python/site-packages/traitlets/traitlets.py", line 528, in get
value = obj._trait_values[self.name]
KeyError: 'template_paths'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/zhengyangzhang/Library/Python/3.8/bin/jupyter-nbconvert", line 8, in <module>
sys.exit(main())
File "/Users/zhengyangzhang/Library/Python/3.8/lib/python/site-packages/jupyter_core/application.py", line 270, in launch_instance
return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
File "/Users/zhengyangzhang/Library/Python/3.8/lib/python/site-packages/traitlets/config/application.py", line 664, in launch_instance
app.start()
File "/Users/zhengyangzhang/Library/Python/3.8/lib/python/site-packages/nbconvert/nbconvertapp.py", line 350, in start
self.convert_notebooks()
File "/Users/zhengyangzhang/Library/Python/3.8/lib/python/site-packages/nbconvert/nbconvertapp.py", line 518, in convert_notebooks
cls = get_exporter(self.export_format)
File "/Users/zhengyangzhang/Library/Python/3.8/lib/python/site-packages/nbconvert/exporters/base.py", line 102, in get_exporter
if getattr(exporter(config=config), 'enabled', True):
File "/Users/zhengyangzhang/Library/Python/3.8/lib/python/site-packages/nbconvert/exporters/templateexporter.py", line 325, in __init__
super().__init__(config=config, **kw)
File "/Users/zhengyangzhang/Library/Python/3.8/lib/python/site-packages/nbconvert/exporters/exporter.py", line 114, in __init__
self._init_preprocessors()
File "/Users/zhengyangzhang/Library/Python/3.8/lib/python/site-packages/nbconvert/exporters/templateexporter.py", line 491, in _init_preprocessors
conf = self._get_conf()
File "/Users/zhengyangzhang/Library/Python/3.8/lib/python/site-packages/nbconvert/exporters/templateexporter.py", line 507, in _get_conf
for path in map(Path, self.template_paths):
File "/Users/zhengyangzhang/Library/Python/3.8/lib/python/site-packages/traitlets/traitlets.py", line 556, in __get__
return self.get(obj, cls)
File "/Users/zhengyangzhang/Library/Python/3.8/lib/python/site-packages/traitlets/traitlets.py", line 535, in get
value = self._validate(obj, dynamic_default())
File "/Users/zhengyangzhang/Library/Python/3.8/lib/python/site-packages/nbconvert/exporters/templateexporter.py", line 518, in _template_paths
template_names = self.get_template_names()
File "/Users/zhengyangzhang/Library/Python/3.8/lib/python/site-packages/nbconvert/exporters/templateexporter.py", line 601, in get_template_names
raise ValueError('No template sub-directory with name %r found in the following paths:\n\t%s' % (base_template, paths))
ValueError: No template sub-directory with name 'lab' found in the following paths:
/Users/zhengyangzhang/Library/Jupyter
/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/share/jupyter
/usr/local/share/jupyter
/usr/share/jupyter
Can someone take a look again and see what's the issue here?
OK, some things to look at. First this is what my path on OSX looks like (
bashbut last time I checkedzshis highly compatible):OK, now, after deactivating my virtualenv, this is what I see:
If I
ls | egrep 'jupyter|pip3'in/Users/xxx/Library/Python/3.8/binI get:So, basically, if you can see
pip3from the shell, your path should work forjupyteras well.Now, if you are using brew, that's where
/usr/local/bin/python3comes in. And that should already be on your path, courtesy ofbrew. I am guessing you have apython3.8entry there, but nopython3.Suggestion:
Maybe you should try to symlink via
ln -s python3.8 python3in that directory and that will make jupyter see that plain oldpython3it wants. You may have tosudoto get that link working (if so make sure your user has appropriate permissions on the link).Also, to see things from plain old Python point of view:
Also, something else to look at. Remember that
which jupyter?Let's look at what it says, and mostly at its shebang.