How can I use virtualenv to use 32-bit and 64-bit Python in Windows?

后端 未结 3 516
抹茶落季
抹茶落季 2021-02-10 22:55

I have 64-bit Python (2.7.5) installed at C:\\Python27 and 32-bit Python at C:\\Python27_32.

I would like to use virtualenv to set up a 32-bit

3条回答
  •  执笔经年
    2021-02-10 23:09

    For your virtual env to run after you have changed your paths you will need to install virtualenv into the 32 bit python - there is nothing stopping you having a copy of virtualenv in each python.

    Assuming you have python 2.7.c 64-bit as your default python and you have also installed python 2.7.x 32-bit you would need both anyway - also assuming that you are on windows your two pythons will be installed somewhere like:

    C:\Python27 and C:\Python27_64

    With the latter on your path.

    Also assuming that you have pip installed in both, you will need it for virtualenv anyway - to install virtualenv to the 32 bit python you can either run:

    Path\To\32Bit\pip install virtualenv
    

    or

    set path=C:\Python27;C:\Python27\Scripts;%path%
    rem The above should set your 32 bit to be found before your 64 bit
    pip install virtualenv
    

提交回复
热议问题