简体   繁体   中英

Install python3 beside Enthought Canopy

I'm developing python code that needs to run under 2.6+ and 3+ (I'm using python-modernize to make the code compatible). The code under development has no C extensions or 3rd party Python package dependencies except for pexpect3.3 which is used solely for testing.

How can I install python 3.4 on OS X 10.9.5 for the sole purpose of testing the code under development, ie I want to be able to run 'python3 myscript.py' but otherwise be sure that python3 will not be invoked as 'python' and without compromising the Enthought Canopy python2.7 environment that's my day-to-day standard for all other python work?

I'm aware, from other SO answers, eg Python 3 in Enthought Canopy , that Canopy doesn't support 3.x, so I'm not trying to make it work in that environment. I just need 3.x for some command line testing.

Should be no problem at all. Just ensure that your Python 3 is not set at installation to be the default Python in Terminal (ie not on PATH). And if for some reason it does end up in PATH, hunt it down and remove it from your ~/.bashrc, ~/.profile, ~/.bash_profile. I prefer to have no default python and only to set it into PATH as needed using an alias.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM