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
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
If you installed the 32Bit version first, and install the 64Bit version second (And you added python to path), Then you can use the updated python launcher (py
) to create the 64Bit version of your virtualenv
py -m venv my-env-name
in command prompt Use:
set CONDA_FORCE_32BIT=1
conda create -n virtualenv_name python=x.x anaconda
The above can be found @ How to install win-32 package on a 64-bit system with conda install I personally tried it and it worked successfully (32-bit python x.x installed). Using Anaconda is not necessary but it will install all of the anaconda packages like pandas.
Disclaimer: The comment below is a caution and not an attack on the answer submitted by anyone else.
As my friend told me "changing the path manually is discouraged, mostly because you'd have to inform other applications that use Python (and that you do not necessarily know of) to point to a different folder, and changes are not certain to be consistent across your system. In a way, virtualenvs do the same but in a cleaner and (sort of) predictable fashion".