Installing python packages with multiple versions on OSX

前端 未结 1 1694
情歌与酒
情歌与酒 2021-01-16 12:37

I am attempting to install a package for python3.4 on Mac OSX 10.9.4. As you know, python ships with OSX, so when I installed python3.4 I was happy to find that it came wit

相关标签:
1条回答
  • 2021-01-16 13:18

    My suggestion is that you start using virtualenv.

    Assuming you have 3.4 installed, then you should also have pyvenv. As for pip and 3.4, it should already be installed.

    Using for example version 3.4 create your own virtual environment and activate it:

    $ mkdir ~/venv
    $ pyvenv-3.4 ~/venv/py34
    $ source ~/venv/py34/bin/activate
    $ deactive                     # does what is says...
    $ source ~/venv/py34/bin/activate
    $ pip install ...  # whatever package you need
    

    With version 2.7 first install virtualenv and then create your own virtual environment and activate it. Make sure that setuptools and pip are updated:

    $ virtualenv-2.7 ~/venv/venv27
    $ . ~/venv/venv27/bin/activate
    $ pip install -U setuptools
    $ pip install -U pip
    $ pip install ...  # whatever package you need
    
    0 讨论(0)
提交回复
热议问题