Mac上使用pip安装jupyter

来源:互联网 发布:spark时间序列算法 编辑:程序博客网 时间:2024/06/05 14:51

在 EI captain 版本以及以上系统的 Mac 上使用pip安装 python 相关的包的时候, 由于sip机制(System Integrity Protection)的不允许命令行写入内容到系统目录, 因此一个比较”优雅”的解决方案就是针对当前用户安装包

pip install jupyter --user your_user_name

安装完成后, 直接在命令行里输入jupyter notebook可能会显示jupyter command not found, 这是由于 pip 安装完 jupyter 后并没有将其加入到 mac 当前运行环境中.

  1. 先找到 jupyter 安装位置, 通常是在/Users/neo(your_user_name)/Libraries/Python/2.7/bin
  2. 将下面命令添加到~/.bash_profile
export export PATH=/Users/neo/Library/Python/2.7/bin/:$PATH
原创粉丝点击