尽管已安装虚拟环境,系统仍找不到它

尽管已安装虚拟环境,系统仍找不到它
gaute@UPG-UBUNTU:~/grr$ sudo apt install virtualenv
Reading package lists... Done
Building dependency tree       
Reading state information... Done
virtualenv is already the newest version (15.0.1+ds-3ubuntu1).
0 upgraded, 0 newly installed, 0 to remove and 125 not upgraded.
gaute@UPG-UBUNTU:~/grr$ virtualenv ~/.virtualenv/GRR
The program 'virtualenv' is currently not installed. You can install it by typing:
sudo apt install virtualenv

我不知道系统发生了什么。我猜可能是有人手动删除了 virtualenv 目录。

答案1

谢谢 Waltinator 的提示。我解决了。只需要创建已安装的参考文件夹virtualenv。我按照下面的方法操作。

sudo /usr/bin/easy_install virtualenv

easy_install python 文件如下所示。

#!/usr/bin/python
# EASY-INSTALL-ENTRY-SCRIPT: 'setuptools==20.7.0','console_scripts','easy_install'
__requires__ = 'setuptools==20.7.0'
import sys
from pkg_resources import load_entry_point

if __name__ == '__main__':
    sys.exit(
        load_entry_point('setuptools==20.7.0', 'console_scripts', 'easy_install')()
    )

相关内容