虚拟环境安装错误

时间:2017-10-31 08:09:05

标签: python-2.7 virtualenv

当我尝试在本地系统中安装虚拟环境时,我收到此错误。你能帮我解决一下这个问题吗?

$ 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

1 个答案:

答案 0 :(得分:2)

你有一个错字。它是virtualenv,而不是virutalenv

此外,由于您已在pip中安装了.local,因此请不要使用virtualenv安装sudo

只需

$ pip install --user virtualenv

应该这样做,virtualenv将在您的用户目录中显示(~/.local/bin如果内存服务,但find ~ -type f -name virtualenv会为您找到它。)

相关问题