python+virtualenv on Cygwin
I have been trying to make my default environment for development to be
- Install Python.
- Download and unzip pip.
- Install by going into the expanded directory and running python setup.py in a command prompt.
- Set the %PYTHONHOME% system variable to the python base directory, (i.e. C:\Python27\) and adding the python base directory and script directory (i.e. C:\Python27\Scripts) to your %PATH% system variable.
- Install Cygwin WITHOUT Python. The previous step tells Cygwin to use the Windows binary.
- Install Cygwin-Virtualenvwrapper using pip install https://bitbucket.org/cliffxuan/virtualenvwrapper-for-cygwin-windows-python/get/tip.tar.gz
- Install virtualenvwrapper-win using pip install virtualenvwrapper-win
- Make a symlink between Cygwin’s virtualenvhome directory and Windows’s using ln -s /cygdrive/c/Users/<USER>/Envs/ ~/.virtualenvs
- Add the following to Cygwin’s .bashrc file:
- export VIRTUALENVWRAPPER_PYTHON=”/cygdrive/c/Python27/python.exe”
- export VIRTUALENVWRAPPER_VIRTUALENV=”/cygdrive/c/Python27/Scripts/virtualenv.exe”
- source virtualenvwrapper.sh
- Go to
C:\User\<username>\Env
(or other%VIRTUALENV_HOME%
location) and usevirtualenv
to start a new environment. Doing this allowsvirtualenvwrapper-win
‘sworkon
command to work.