[英]Running jupyter produces "ModuleNotFoundError: No module named 'six'"
I've just upgraded to OSX 11.0.1.我刚刚升级到 OSX 11.0.1。 Now when I try to run a jupyter notebook I'm getting this error:
现在,当我尝试运行 jupyter 笔记本时,出现此错误:
% jupyter notebook
Traceback (most recent call last):
File "/usr/local/bin/jupyter-notebook", line 5, in <module>
from notebook.notebookapp import main
File "/usr/local/lib/python3.8/site-packages/notebook/notebookapp.py", line 83, in <module>
from .services.kernels.kernelmanager import MappingKernelManager, AsyncMappingKernelManager
File "/usr/local/lib/python3.8/site-packages/notebook/services/kernels/kernelmanager.py", line 18, in <module>
from jupyter_client.session import Session
File "/usr/local/lib/python3.8/site-packages/jupyter_client/session.py", line 41, in <module>
from jupyter_client.jsonutil import extract_dates, squash_dates, date_default
File "/usr/local/lib/python3.8/site-packages/jupyter_client/jsonutil.py", line 10, in <module>
from dateutil.parser import parse as _dateutil_parse
File "/usr/local/lib/python3.8/site-packages/dateutil/parser/__init__.py", line 2, in <module>
from ._parser import parse, parser, parserinfo, ParserError
File "/usr/local/lib/python3.8/site-packages/dateutil/parser/_parser.py", line 42, in <module>
import six
ModuleNotFoundError: No module named 'six'
If I do pip install six
I see:如果我执行
pip install six
我会看到:
Requirement already satisfied: six in
/usr/local/Cellar/protobuf/3.13.0_1/libexec/lib/python3.9/site-packages (1.15.0)
I'm quite confused by this as (a) I don't know what this path is and (b) it doesn't seem to be in my PATH
or PYTHONPATH
, so I don't know why pip is looking for it there.我对此感到很困惑,因为 (a) 我不知道这条路径是什么,并且 (b) 它似乎不在我的
PATH
或PYTHONPATH
,所以我不知道为什么 pip 在那里寻找它.
What should I do?我该怎么办?
For reference:以供参考:
I think I installed jupyter via pip originally I don't know how I installed jupyter, and I'm not using anaconda (and would prefer to continue not to do so).我想我最初是通过 pip 安装了 jupyter
我不知道我是如何安装 jupyter 的,而且我没有使用 anaconda(并且宁愿继续不这样做)。 Other info in case useful:
其他有用的信息:
% type jupyter
jupyter is /usr/local/bin/jupyter
% type python
python is an alias for /usr/local/bin/python3
% ls -al /usr/local/bin/python3
lrwxr-xr-x 1 me admin 40 12 Nov 23:12 /usr/local/bin/python3 -> ../Cellar/python@3.9/3.9.0_1/bin/python3
Update: if I do pip list -v
then I can see that most packages are where I'd expect them to be, with the exception of protobuf and six.更新:如果我执行
pip list -v
然后我可以看到大多数包都在我期望的位置,除了 protobuf 和 6。 I wonder why they are in a different location?我想知道为什么他们在不同的地方?
% pip list -v
Package Version Location Installer
----------------------- --------- ----------------------------------------------------------------------- ---------
appdirs 1.4.4 /usr/local/lib/python3.9/site-packages pip
asgiref 3.3.1 /usr/local/lib/python3.9/site-packages pip
...
protobuf 3.13.0 /usr/local/Cellar/protobuf/3.13.0_1/libexec/lib/python3.9/site-packages
...
six 1.15.0 /usr/local/Cellar/protobuf/3.13.0_1/libexec/lib/python3.9/site-packages
I just ran into the same error (in OS 11.1 and py3.8).我刚刚遇到了同样的错误(在 OS 11.1 和 py3.8 中)。
And running pip install --ignore-installed six
did the trick for me.运行
pip install --ignore-installed six
对我pip install --ignore-installed six
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.