当我试图在我的本地系统中安装一个虚拟环境时,我得到了这个错误。你能帮我解决这个问题吗?
$ pip -V
pip 9.0.1 from /home/sysadmin/.local/lib/python2.7/site-packages (python 2.7)
$ sudo pip install virutalenv
sudo: unable to resolve host sysadmin-Veriton-M200-H61
The directory '/home/sysadmin/.cache/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 '/home/sysadmin/.cache/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 virutalenv
Could not find a version that satisfies the requirement virutalenv (from versions: )
No matching distribution found for virutalenv发布于 2017-10-31 16:18:30
你有一个打字错误。是virtualenv,不是virutalenv。
另外,由于您已经在.local中安装了pip,因此请不要使用sudo安装virtualenv。
只是
$ pip install --user virtualenv应该这样做,virtualenv将在您的用户目录中可用(~/.local/bin如果内存允许,但find ~ -type f -name virtualenv会为您找到它)。
https://stackoverflow.com/questions/47030591
复制相似问题