[英]Pip is installed, but command not found
Pip已经在我的机器上使用了多年,但是最近我无法使其正常工作。 为了解决这个问题,我跑了:
$ sudo python get-pip.py
The directory '/Users/tomeldridge/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/Users/tomeldridge/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting pip
Downloading pip-8.1.2-py2.py3-none-any.whl (1.2MB)
100% |████████████████████████████████| 1.2MB 759kB/s
Collecting wheel
Downloading wheel-0.29.0-py2.py3-none-any.whl (66kB)
100% |████████████████████████████████| 71kB 4.3MB/s
Installing collected packages: pip, wheel
Found existing installation: pip 7.1.2
Uninstalling pip-7.1.2:
Successfully uninstalled pip-7.1.2
Successfully installed pip-8.1.2 wheel-0.29.0
但是pip仍然不起作用:
$ pip --version
-bash: pip: command not found
我想可能是因为$PATH
引起了这个问题。
当我运行`sudo bash -c'echo $ PATH'时,我得到:
/usr/sbin:/usr/bin:/sbin:/bin:usr/local/bin
这个对吗?
您的问题是路径中的usr/local/bin
,它必须是/usr/local/bin
。
那应该做。
您应该可以在~/.bash_profile
文件中进行更改。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.