在Mac上进行Jupyter安装失败 [英] Jupyter install fails on Mac

查看:596
本文介绍了在Mac上进行Jupyter安装失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Mac(OS X El Capitan)上安装Jupyter,并且在响应时出现错误:

I'm trying to install Jupyter on my Mac (OS X El Capitan) and I'm getting an error in response to:

sudo pip install -U jupyter

首先下载/安装开始正常,但是随后我遇到了这个问题:

At first the download/install starts fine, but then I run into this:

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).他们不仅运送了已经安装的一些相当奇怪的3rd Party软件包,而且还运送了那些软件包的奇怪(旧)和beta版本.此外,它们受到受系统保护的.

The default OS X Python that El Capitan ships with is unfortunately rather badly mispackaged (grrr, Apple). Not only have they shipped some rather strange 3rd party packages already installed, but strange (old) and beta versions of those packages. Furthermore, they are heavily system protected.

这使默认的python rather 变得不友好(如您所知).在您的特定情况下,juypter希望安装六个库的最新版本,但是系统安装的版本是一个奇怪的旧版本,并且不会让pip更新它(jupyter需要更新的版本).

This makes the default python rather unfriendly to do work with (as you have found out). In your specific case, juypter would like to install a recent version of the six library, but the system installed version is a strange old one and will not let pip update it (jupyter requires an updated version).

总的来说,为了减轻将来的所有麻烦,我建议您使用不同版本的python,并将其放在您的路径上,这是您的新默认设置.有两种选择.重要的是一次只能使用一个(否则,它们很容易使彼此混淆,或者使您感到困惑).

In general, to alleviate all future headaches, I recommend getting a different distribution of python, and putting that on your path so it is your new default. There are a couple of choices; what's important is only using one at a time (otherwise they're apt to confuse eachother, or confuse you).

  1. Python.org -来自Python开发人员本身
  2. 自制软件-OS X的unixy软件包管理器,其中包含正常运行的python包
  3. Anaconda Python -科学的python发行版,具有许多难于安装"的科学版本已可用且可以正常使用"的软件包(包括jupyter).
  1. Python.org - From the Python developers themselves
  2. Homebrew - a unixy package manager for OS X, which has a normally-functioning python package
  3. Anaconda Python - A scientific python distribution, with many 'harder-to-install' scientific packages already available and 'just working' (including jupyter).

如果您不知道选择什么,我建议暂时使用Anaconda.

I recommend going with Anaconda for now, if you don't know what to choose.

这篇关于在Mac上进行Jupyter安装失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆