Pip packages not found - Brewed Python

后端 未结 3 1837
南方客
南方客 2020-12-17 09:42

Running Python 2.7.3, installed with HomeBrew, on a mac.

Installed several packages using PIP, including virtualenv. (Using virtualenv as an example, but NONE of the

3条回答
  •  长情又很酷
    2020-12-17 10:21

    Download virtualenv.py if your system does not provide virtualenv command:

    curl -L -o virtualenv.py https://raw.github.com/pypa/virtualenv/master/virtualenv.py
    

    First create your virtualenv folder:

     python virtualenv.py venv # venv <-- name of the folder
    

    You need run virtualenv's activate in shell:

     . venv/bin/activate
    

    or

     source venv/bin/activate
    

    This fixes PYTHONPATH and PATH. You do this once per each shell session. Then python command will magically work :)

    Now run pip, packages will be installed in venv.

    More info (disclaimer, I am the author) http://opensourcehacker.com/2012/09/16/recommended-way-for-sudo-free-installation-of-python-software-with-virtualenv/

提交回复
热议问题