Python Jupyter安装在Mac上失败
我正试图在我的Mac(OS X El Capitan)上安装Jupyter,但收到一个错误,原因是:Python Jupyter安装在Mac上失败,python,macos,jupyter,failed-installation,Python,Macos,Jupyter,Failed Installation,我正试图在我的Mac(OS X El Capitan)上安装Jupyter,但收到一个错误,原因是: sudo pip install -U jupyter 一开始下载/安装很好,但后来我遇到了以下问题: Installing collected packages: six, singledispatch, certifi, backports-abc, tornado, jupyter-core, pyzmq, jupyter-client, functools32, jsonschema,
sudo pip install -U jupyter
一开始下载/安装很好,但后来我遇到了以下问题:
Installing collected packages: six, singledispatch, certifi, backports-abc, tornado, jupyter-core, pyzmq, jupyter-client, functools32, jsonschema, nbformat, pygments, mistune, MarkupSafe, jinja2, nbconvert, path.py, pickleshare, simplegeneric, setuptools, gnureadline, appnope, ptyprocess, pexpect, ipython, ipykernel, terminado, notebook, ipywidgets, jupyter-console, qtconsole, jupyter
Found existing installation: six 1.4.1
DEPRECATION: Uninstalling a distutils installed project (six) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling a distutils project will only partially uninstall the project.
Uninstalling six-1.4.1:
Exception:
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/pip/basecommand.py", line 209, in main
status = self.run(options, args)
File "/Library/Python/2.7/site-packages/pip/commands/install.py", line 317, in run
prefix=options.prefix_path,
File "/Library/Python/2.7/site-packages/pip/req/req_set.py", line 726, in install
requirement.uninstall(auto_confirm=True)
File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line 746, in uninstall
paths_to_remove.remove(auto_confirm)
File "/Library/Python/2.7/site-packages/pip/req/req_uninstall.py", line 115, in remove
renames(path, new_path)
File "/Library/Python/2.7/site-packages/pip/utils/__init__.py", line 267, in renames
shutil.move(old, new)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 302, in move
copy2(src, real_dst)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 131, in copy2
copystat(src, dst)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 103, in copystat
os.chflags(dst, st.st_flags)
OSError: [Errno 1] Operation not permitted: '/tmp/pip-ByX5xW-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/six-1.4.1-py2.7.egg-info'
我能做些什么来解决这个问题?El Capitan附带的默认OS X Python很不幸地存在严重的打包错误(grrr,Apple)。他们不仅提供了一些已经安装的非常奇怪的第三方软件包,而且还提供了这些软件包的奇怪(旧)和beta版本。此外,它们也非常重要 这使得使用默认的python非常不友好(您已经发现)。在您的特定情况下,juypter希望安装six库的最新版本,但系统安装的版本是一个奇怪的旧版本,不会让pip更新它(jupyter需要更新的版本) 总的来说,为了缓解所有未来的麻烦,我建议使用不同的python发行版,并将其放在您的路径上,因此这是您的新默认版本。有两种选择;重要的是一次只使用一个(否则它们很容易相互混淆,或者混淆你)
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew update
brew upgrade
安装Python:
brew install python
或Python 3:
brew install python3
升级/安装:
pip install --upgrade pip setuptools
安装jupyter:
pip install jupyter
注意:您可能需要将sudo-H
与pip安装一起使用
,或者您可以尝试一下
sudo pip install -U jupyter --upgrade --ignore-installed six
此命令将为当前登录的用户安装
jupyter
,而不忽略任何内容:
sudo pip install --user jupyter
非常感谢您的详尽回答。我喜欢Python,并且已经使用它一年多了,但我总是遇到这样的问题。肯定Mac OS系统的设置没有达到预期效果是非常有帮助的。至少它不会进入一个没有任何输出的无限循环:/(举例说明)