How To Install Python Packages In Cygwin
If you are new to, or is, Alex Clemesha’s excellent is a must-read. In short: virtualenv lets you switch seamlessly between isolated Python environments, Fabric automates remote deployment, while pip takes care of installing required packages and dependencies. If you have ever had to wrestle with more than one development project at the same time, then virtualenv is one of those tools that, once mastered, you can’t see yourself living without. Fabric and pip are somewhat immature, but still highly useful in their present shapes. It is likely that you will end up learning them anyway. Best of all, these three tools play very nicely together.
Here at, we spend quite a lot of our time on Windows platforms. While Cygwin adds a fair amount of unix functionality to Windows, configuring certain applications can be difficult. This article describes the steps we go through to get an operational virtualenv, Fabric and pip setup on Windows Vista. It also gives you a brief taster of how virtualenv and Fabric works. Step 1 – Install Cygwin: If you haven’t already, Cygwin can be installed from. Click the “View” button once to get a full list of available packages.
Make sure to include at least the following packages (the numbers in the parentheses indicate the versions used at the time of writing):. python (2.5.2-1). python-paramiko (1.7.4-1). python-crypto (2.0.1-1).
gcc (3.4.4-999). wget (1.11.4-3). openssh (5.1p1-10) Now would also be a good time to install other common packages such as vim, git, etc.—but you can always go back and install them at a later time. Note that we are using Cygwin Python rather than the standard Windows Python.
I had nothing but trouble trying to get Windows Python to play nicely along with virtualenv and Fabric, so this is a compromise. The downside is that you are stuck with a rather dated and somewhat buggy version of Python.
If someone manages to get this setup working with Windows Python, then let me know! Step 2 – Get paramiko working: The python-paramiko and python-crypto packages are required to get Fabric deployment over SSH working properly. If you are lucky, paramiko should work out of the box. If you don’t get the following error message when importing paramiko then skip the rest of this step: $ python Python 2.5.2 (r252:60911, Dec 2 2008, 09:26:14) GCC 3.4.4 (cygming special, gdc 0.12, using dmd 0.125) on cygwin Type 'help', 'copyright', 'credits' or 'license' for more information. import paramiko Traceback (most recent call last): File ', line 1, in File 'init.py', line 69, in File 'transport.py', line 32, in File 'util.py', line 31, in File 'common.py', line 101, in File 'rng.py', line 69, in init File 'randpool.py', line 87, in init File 'randpool.py', line 120, in randomize IOError: Errno 0 Error According to the discussion, this appears to be a lingering Cygwin bug. The workaround is to change line 120 in /usr/lib/python2.5/site-packages/Crypto/Util/randpool.py from if num!=2: raise IOError, (num, msg) to if num!=2 and num!=0: raise IOError, (num, msg) Paramiko should now import without any complaints. Step 3 – Install setuptools: Setuptools are required for installing the rest of the required Python packages.
Instructions for Cygwin are found on the pages—but just enter the following and you’ll be all set: $ wget $ sh setuptools-0.6c9-py2.5.egg Step 4 – Install pip, virtualenv and virtualenvwrapper: We haven’t said anything about so far. This extension to virtualenv streamlines working with multiple environments and is well recommended: $ easyinstall pip $ easyinstall virtualenv $ easyinstall virtualenvwrapper $ mkdir /.virtualenvs That last line creates a working directory for your virtual Python environments. Working with an environment named myenv, all packages will be installed in /.virtualenvs/myenv. I find it useful to create and activate a default environment called sandbox. This helps prevent package installations to the default Python site-packages. It’s a good strategy in general to avoid polluting the main package directory so that almost all package installations are per project and virtual environment.

How To Install Python 3.4 In Cygwin
Run the following commands to create the sandbox environment: $ export WORKONHOME=$HOME/.virtualenvs $ export PIPVIRTUALENVBASE=$WORKONHOME $ source /usr/bin/virtualenvwrapperbashrc $ mkvirtualenv sandbox mkvirtualenv is a virtualenvwrapper command that creates the given environment. 12 Responses to “How to get pip/virtualenv/Fabric working on Cygwin”. Says: FWIW: virtualenv 1.4.5.post1 seems to work (not very tested) with cygwin & win32 Python if you patch it:. Luis M. Says: i think the anoying problem you been having can be solve by using.
Cd cygwin bin ash PATH=. Rebaseall -v. Sancho Pansa Says: it is my experience, that generally you should avoid using windows and cygwin for serious development work with python – you will bounce your head against more and more problems, lxml is a problem, python-mysql is a problem, and if you have strange errors while debugging your own stuff, you can never be sure, if it is an error you have in your code or if it is a cygwin issue – overall it adds another level of unneeded complexity and lots of boring problems. To avoid all this just use a virtual machine.
You can still use your favorite windows tools if you install samba into the virtual machine and export your home to a samba share, which can be mounted on the host machine. I spent many ours and always came to this conclusion – development with python on windows is still a pita, use a linux vm to save many hours!. cdr Says: The Fabric fix for cygwin went in, so you can use the master with pip until the next release rather than manually patching and manually installing. Says: for Python Extension Packages. I’ve tried them, and they would still refuse to work. – How to get pip/virtualenv/Fabric working on Cygwin is a good source to figure things out on.
How To Install Python In Cygwin
Says: This a post from 3 years ago but it’s still working! Although had to update the version numbers, but still working!. Says: 回复:解决方案安装 easyinstallpip 和 virtualenv.
How To Install Python 3 In Cygwin
tapple Says: I just followed these instructions. Very helpful. One issue: virtualenvwrapperbashrc appears to have changed to virtualenvwrapper.sh since this was written. Says: “get pip” manual to install pip, Cygwin users are recommended to follow these guidelines in atbrox. Says: 参考:. Says: Install & configure pip, virtualenv & virtualenvwrapper as per.
Says: This post looks promising Leave a Reply Name (required) Mail (will not be published) (required) Website.