Why can't `virtualenv` find `pkg_resources`?

前端 未结 3 740
南方客
南方客 2021-02-15 02:01

I\'m trying to use virtualenv in Ubuntu to install a local virtual Python environment. When I run the shell command:

$ virtualenv ./virt_python
<
3条回答
  •  礼貌的吻别
    2021-02-15 02:34

    1. Check the current version of virtualenv. As answered by user2676043 in the same thread, virtualenv is installed in /usr/local/lib/python2.7/dist-packages. So run the following command:

      $ python /usr/local/lib/python2.7/dist-packages/virtualenv.py --version

    It will return you the version of virtualenv installed on system.

    1. Now, change the executable file.

      $ vim /usr/local/bin/virtualenv

    Change the version to the one received above. Save the file and it works smoothly.

提交回复
热议问题