Mac安装ipython3路径环境配置异常

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/weixin_42681866/article/details/82800492

安装指令

  1. 安装ipython2: pip install ipython
  2. 安装ipython3: pip3 install ipython

安装后状态

  本人仅安装ipython3,安装后可能会报路径异常,查看了很多文章,发现关于该情况的解决甚少,这边主要提供路径环境异常的解决方法。 安装后报如下警:

在这里插入图片描述

也就是图中黄色部分:The script pygmentize is installed in ‘/Library/Frameworks/Python.framework/Versions/3.7/bin’ which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
The scripts iptest, iptest3, ipython and ipython3 are installed in ‘/Library/Frameworks/Python.framework/Versions/3.7/bin’ which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.

解决思路

  根据报警第4段提供的解决方法:Consider adding this directory to PATH,很明显是让我们把文件目录加到Mac环境路径中,那这里就要了解两个情况:
  • Mac的Path路径默认指的是:/usr/local/bin
  • 当前的ipython装的路径通过报警第1段可以知道位于:/Library/Frameworks/Python.framework/Versions/3.7/bin

解决方法

  那方法就很简单了,把iptest, iptest3, ipython, ipython3四个文件夹从原路径移到Path路径就行了。
  • 首先进入原路径:cd /Library/Frameworks/Python.framework/Versions/3.7/bin
  • 然后查看四个文件是否都在:ls(结果如下图)
  • 执行mv命令:mv iptest iptest3 ipython ipython3 /usr/local/bin就ok了
  • 最后执行ipython发现可以使用了。
    在这里插入图片描述
    在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/weixin_42681866/article/details/82800492