Python问题pip: command not found

论坛 期权论坛 编程之家     
选择匿名的用户   2021-5-30 12:54   11   0

使用pip指令($ pip --version)时报如下错误:

----------------------------------------------------------------------------------------------------------------------------------------------------------------

Command 'pip' is available in '/usr/local/bin/pip'
The command could not be located because '/usr/local/bin' is not included in the PATH environment variable.
pip: command not found

----------------------------------------------------------------------------------------------------------------------------------------------------------------

解决方案:这是因为环境变量没有添加,按照如下方式添加环境变量。

$ sudo gedit /etc/profile

打开/etc/profile文件之后,向该文件中添加/usr/local/bin路径(上面报错的路径),然后保存。第二步执行下面的语句:

$ source /etc/profile

问题解决。

分享到 :
0 人收藏
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

积分:3875789
帖子:775174
精华:0
期权论坛 期权论坛
发布
内容

下载期权论坛手机APP