How to set Python's default version to 3.x on OS X?

前端 未结 21 1954
滥情空心
滥情空心 2020-11-22 07:52

I\'m running Mountain Lion and the basic default Python version is 2.7. I downloaded Python 3.3 and want to set it as default.

Currently:

$ python
           


        
21条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-22 08:17

    I'm not sure if this is available on OS X, but on linux I would make use of the module command. See here.

    Set up the modulefile correctly, then add something like this to your rc file (e.g. ~/.bashrc):

    module load python3.3
    

    This will make it so that your paths get switched around as required when you log in without impacting any system defaults.

提交回复
热议问题