Using VirtualEnv with multiple Python versions on windows

前端 未结 6 2031
孤街浪徒
孤街浪徒 2020-12-06 01:21

I have python 2.7.6 and 3.4.0 on my machine. The 2.7 version is on my path. I would like to set up a virtualenv using 3.4. There are many postings on SO and elsewhere that s

6条回答
  •  广开言路
    2020-12-06 01:59

    Had to play around with this for a while to get it right. Had Python2.7.9 installed (Windows 7), wanted to take the latest Python3 release for a spin. After installing Python3.4.3 I went to directory bar and created a virtual environment foo with this command:

    virtualenv -p c:\Python34\python.exe foo
    

    It took me quite some time to understand that I needed to install the Python3.4.3 interpreter in the 'normal' fashion, I originally thought it would be installed USING virtualenv. That was explained in this answer. I did not touch the pythonpath in Windows after installing Python3.4.3.

提交回复
热议问题