Install python module to non default version of python on Mac

后端 未结 3 1352
遥遥无期
遥遥无期 2021-01-12 02:59

I have a couple different versions of Python installed on my Mac. The default version is 2.5, so when I install a module it gets installed to 2.5. I need to be able to insta

3条回答
  •  [愿得一人]
    2021-01-12 03:40

    If you've installed them using macports then you run (as root):

    port select --set python 
    

    Hint: To list available versions run:

    port select --list python
    

    Otherwise you can set the $PYTHON_PATH environment variable and add your desired python path to your $PATH environment variable as well.

    You will also need to update the python.current (or something with similar name) symbolic link in /Library/Frameworks/Python.framework.


    I strongly recommend to install all the versions using a package manager (homebrew, macports, fink, etc.) so they'll be easier to manage.

提交回复
热议问题