使用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
问题解决。