简体   繁体   中英

How to install virtual environment with python 3 without upgrading existing version of python on my OSX which is 2.7

Is it possible to have a virtual environment setup with python 3 if my OS has python 2.7 installed, I am using "$ virtualenv python3env -p python3" but its trying to look for a PATH for python3 on my system. Is there a work around for this problem?

  1. install python3, DON'T delete your python2

  2. after installing python3, make sure the to add the directory to PATH

  3. change the binary(python,pythonw) inside python3 to python3/pythonw3

  4. try to setup virtual environment using the same command in your post and you should now created a python3 virtual environment

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