如何为python2.7安装virtualenv?

问题描述 投票:0回答:1

我尝试了here建议的方法来安装virtualenv。然而,它给出了一个令人困惑的错误:

% /usr/bin/python2.7 -m pip install virtualenv
Collecting virtualenv
  Using cached https://files.pythonhosted.org/packages/94/d7/adb787076e65dc99ef057e0118e25becf80dd05233ef4c86f07aa35f6492/virtualenv-20.25.0.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
    IOError: [Errno 2] No such file or directory: '/tmp/pip-build-toC2d7/virtualenv/setup.py'
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-toC2d7/virtualenv/

我已经安装了一些virtualenv;我尝试按照建议删除它here但这也不起作用:

% pip uninstall virtualenv
Cannot uninstall requirement virtualenv, not installed

如何为python2.7安装virtualenv?

python-2.7 installation virtualenv
1个回答
0
投票

以下似乎有效:

apt-get install python-virtualenv

pip
常常是麻烦。

© www.soinside.com 2019 - 2024. All rights reserved.