4

I'm trying to install Python Fabric on Windows 7 using the guide from Getting Python and Fabric Installed on Windows.

What i did so far:

This seemed to work fine until now. When I try to install Fabric via easy_install Fabric it starts to download the files, but then i get an chmod error.

Using c:\python27\lib\site-packages\fabric-1.3.4-py2.7.egg  
Processing dependencies for fabric  
Searching for pycrypto>=2.1,!=2.4  
Reading http://pypi.python.org/simple/pycrypto/  
Reading http://pycrypto.sourceforge.net  
Reading http://www.amk.ca/python/code/crypto  
Reading http://www.pycrypto.org/  
Best match: pycrypto 2.5  
Downloading http://ftp.dlitz.net/pub/dlitz/crypto/pycrypto/pycrypto-2.5.tar.gz  
Processing pycrypto-2.5.tar.gz  
Running pycrypto-2.5\setup.py -q bdist_egg --dist-dir   c:\users\birgit\appdata\local\temp\easy_install-nzrlow\pycrypto-2.5\egg-dist-tmp-_pwkm4  
The command "chmod" is spelled wrong or could not be found.

Traceback (most recent call last):
 File "C:\Python27\Scripts\easy_install-script.py", line 8, in <module> load_entry_point('setuptools==0.6c12dev-r88846', 'console_scripts', 'easy_install')()  
 File "C:\Python27\lib\site-packages\setuptools-0.6c12dev_r88846-py2.7.egg\setuptools\command\easy_install.py", line 1712, in main  

 ... lots and lots of lines... (if they are relevant, I'll post them)

 File "C:\Python27\lib\distutils\dist.py", line 972, in run_command cmd_obj.run()  
 File "setup.py", line 269, in run  
RuntimeError: chmod error  

Any suggestions to solve the problem?

Community
  • 1
  • 1
DIF
  • 2,470
  • 6
  • 35
  • 49
  • 3
    have you tried a binary installer from Unofficial Windows Binaries for Python Extension Packages: [Base distribution may contain Fabric](http://www.lfd.uci.edu/~gohlke/pythonlibs/). – jfs Feb 03 '12 at 16:01
  • The unofficial Windows Binaries helped solving the described Problem! Thank you! – DIF Feb 06 '12 at 08:06
  • I got the same Problem with PyCrypto and solved it again by using a [binary installer](http://www.voidspace.org.uk/python/modules.shtml#pycrypto) as suggested in [this question](http://stackoverflow.com/questions/1687283/why-cant-i-just-install-the-pycrypto) - and now finally I'm able to run Python Fabric scripts! – DIF Feb 06 '12 at 08:25

4 Answers4

9

I have just managed to install fabric on win7 box, using information from various places in the net. That was really annoying, so just to save others frustration I put together the following list.

  1. Install pip http://www.pip-installer.org/en/latest/index.html (that's easy, follow the guide on the web site, goes without problems)
  2. run from command line pip install fabric - you'll get errors, some stuff about missing bat files, etc. while installing pycrypto.
  3. Download precompiled pycrypto package from http://www.voidspace.org.uk/downloads/ for your version of Python, for instance for 2.7 it is http://www.voidspace.org.uk/downloads/pycrypto-2.1.0.win32-py2.7.zip
  4. run again from command line pip install fabric - this time everything seems to be ok, until you try to run fabric script. It will complain about "No module named win32api", etc.
  5. Install that missing win32api from http://sourceforge.net/projects/pywin32/files/pywin32/ - first choose a build version (newest, probably) and then again .exe file for your Python version.

And you are done, fabric should work ok.

Piotr Kochański
  • 21,862
  • 7
  • 70
  • 77
  • The pycrypto install didn't detect my python install - but still said it succeeded - be careful there. – Jody Oct 29 '13 at 17:07
  • Pycrypto also failed to install properly. Had to move some files manually from c:\PythonX\ to c:\Python27\. Had gotten the error "No module named OSRNG" Found the answer here: http://devblog.alexsapps.com/2012/10/solution-to-importerror-no-module-named.html – Jody Oct 29 '13 at 17:18
2

have you tried a binary installer from Unofficial Windows Binaries for Python Extension Packages: Base distribution may contain Fabric.

jfs
  • 399,953
  • 195
  • 994
  • 1,670
1

If you're using virtualenv, you need to add one point to Piotr Kochanski's answer: when creating the virtualenv, allow it to access the system packages so it can see pycrypto. By default it disallows this.

These steps worked for me:

  1. Install pycrpyto binary from http://www.voidspace.org.uk/python/modules.shtml#pycrypto.
  2. Create a virtual env that can access the system packages. For example:

    c:\Python27\Scripts\virtualenv.exe --system-site-packages c:\Proj\virtualenv

  3. pip install fabric

Dan Benamy
  • 839
  • 8
  • 14
  • Now that I think about it, I wonder if I could have installed pycrypto into the virtualenv and not needed to allow access to the system packages. Maybe I'll try that next time. – Dan Benamy Nov 27 '12 at 18:10
  • 1
    Yes, you could have using `easy_install` from within the virtual environment: `easy_install .\pycrypto-2.6.win32-py2.7.exe`. – jpmc26 May 08 '14 at 11:12
0

1.Create a virtualenv (I usually put all mine on the desktop)

2.Download the binary of pycrypto (matching your installed python version and architecture -- no support for python3 as of now) - http://www.voidspace.org.uk/python/modules.shtml

3.Navigate to the easy_install executable (under Lib\site-packages) within the virtualenv folder you created and run the pycrypto install - 'easy_install C:\path\to\the\download\pycrypto-2.6.win-amd64-py2.7.exe'

4.Activate the virtualenv and 'pip install fabric'

snassr
  • 1,228
  • 14
  • 10