Fixing PATH for Python libraries using Bash

时光总嘲笑我的痴心妄想 提交于 2020-05-13 07:10:46

问题


I am attempting to install some Python libraries by executing variations of the following command in Bash:

pip install --user -U numpy

I installed Python3 using Homebrew.

I then get variations of the following message each time:

WARNING: The scripts f2py, f2py3 and f2py3.7 are installed in '/Users/x/Library/Python/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.

I want to fix this issue to avoid problems in the future. I would greatly appreciate it if people could please take the time to explain how to do this.


回答1:


The error message is telling you to add /Users/you/Library/Python/3.7/bin to your path.

To do that, use a text editor to open /Users/you/.bashrc, and as the very last line add:

export PATH=/Users/you/Library/Python/3.7/bin:$PATH

Then you'll need to launch a new Terminal window for those settings to take effect. (you could make it take effect in your current shell by entering the line directly into your shell)



来源:https://stackoverflow.com/questions/58051467/fixing-path-for-python-libraries-using-bash

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!