virtualenv does not include pip

后端 未结 3 1519
挽巷
挽巷 2020-12-08 15:12

I am trying to create a virtual environment using virtualenv on Mac OS X El Capitan. I have installed Python 2.7.11 with brew, which includes

3条回答
  •  不知归路
    2020-12-08 15:47

    1. virtualenv executable is not placed in /usr/local/bin after pip makes its job, so I need to ln -s it by hand (it may indicate, that there is something wrong with installation on this step).

    Don't do that. That will only hide the bug and not solve the problem. Here's a short guide how to debug this kind of issues:

    • Start with which -a python. The first path you see should be /usr/local/bin/python, if not check your PATH variable.

    • Next, check which -a pip. Again the first path should be /usr/local/bin/pip. If not, run python -m ensurepip and recheck.

    • Now install virtualenv using pip install virtualenv, after that check the output of which -a virtualenv. The first path should be /usr/local/bin/virtualenv, if not check the output of env |grep PYTHON for unexpected environment variables.

    • Finally check the output of virtualenv --version to make sure you have the latest version.

提交回复
热议问题