我需要在Python 2.7上运行IPython Notebook。那就是我找到的他的解决方案:
python2 -m pip install ipykernel
python2 -m ipykernel install --user
但是,第二行返回错误:
...
File "/Users/Zaira/Library/Python/2.7/lib/python/site-packages/dateutil/tz/tz.py", line 21, in <module>
from six.moves import _thread
ImportError: cannot import name _thread
所以我再次用谷歌搜索,找到了许多解决方案,但没有一个可行:
pip uninstall python-dateutil
pip install python-dateutil --upgrade
或
sudo pip uninstall python-dateutil
sudo pip install python-dateutil==2.2
或(未经许可)
rm -rf /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/six.*
有没有办法选择要在macOS Mojave 10.14.3上的IPython Notebook中使用的python版本?