无法安装Jupyter Notebook

时间:2018-05-04 21:00:30

标签: python pip jupyter-notebook

我正在尝试在我的虚拟环境中安装jupyter笔记本。我在我的虚拟环境和最新的pip版本上运行了python 3.5。我在使用pip安装几乎所有库时遇到问题。即使我运行以下命令,它也会出现以下错误:

python3 -m pip install --upgrade pip
python3 -m pip install jupyter

错误:

The directory '/Users/[user]/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/Users/[user]/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting jupyter
  Could not fetch URL https://pypi.python.org/simple/jupyter/: There was a problem confirming the ssl certificate: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:645) - skipping
  Could not find a version that satisfies the requirement jupyter (from versions: )
No matching distribution found for jupyter

1 个答案:

答案 0 :(得分:1)

啊,是的,在MacOS上正确安装Python的永恒问题......

您应该使用brew来安装python以防止出现这些问题,因为它会将您设置为所有目录的正确所有者,而不是root。这似乎是一个很好的指南:How can I use Homebrew to install both Python 2 and 3 on Mac?

或者,您可以使用sudo运行上面的代码,但这是不鼓励的做法。