Problems installing Python Fabric on Windows 7

旧巷老猫 提交于 2019-12-03 16:26:30

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.

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

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

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'

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!