在 Windows 7 上安装 Python Fabric 时出现问题

发布于 2025-01-02 04:55:50 字数 2179 浏览 1 评论 0 原文

我正在尝试使用 在 Windows 上安装 Python 和 Fabric

到目前为止我做了什么:

  • 安装 Python 2.7 到 C:\Python27
  • 添加 安装的Windows 系统路径的 Python 目录和 Python/脚本
  • SetupTools
  • 已安装 MinGW
  • 将 MinGW-Directory 添加到系统路径
  • <一个href="https://stackoverflow.com/questions/2817869/error-unable-to-find-vcvarsall-bat/2838827#2838827">修改了 distutils.cfg 以匹配 MinGW-Path

这似乎到目前为止工作正常。当我尝试通过 easy_install Fabric 安装 Fabric 时,它开始下载文件,但随后出现 chmod 错误

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  

有什么解决问题的建议吗?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

花开半夏魅人心 2025-01-09 04:55:50

我刚刚使用网络上各个地方的信息设法在 win7 盒子上安装了fabric。这真的很烦人,所以为了避免其他人沮丧,我整理了以下列表。

  1. 安装 pip http://www.pip-installer.org/en/latest/index .html (这很简单,按照网站上的指南操作,没有问题)
  2. 从命令行运行 pip install Fabric - 你会得到错误,一些关于丢失bat文件的东西,安装 pycrypto 时等。
  3. http://www.voidspace.org.uk/downloads/ 下载预编译的 pycrypto 包 < em>对于您的Python版本,例如2.7,它是http://www.voidspace.org.uk/downloads/pycrypto-2.1.0.win32-py2.7.zip
  4. 从命令行再次运行pip install Fabric - 这次一切似乎都正常,直到您尝试运行 Fabric 脚本。它会抱怨“没有名为 win32api 的模块”等。
  5. http:// 安装缺少的 win32api sourceforge.net/projects/pywin32/files/pywin32/ - 首先选择一个构建版本(可能是最新的),然后再次选择适合您的 Python 版本的 .exe 文件。

你就完成了,布料应该可以正常工作。

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.

椵侞 2025-01-09 04:55:50

您是否尝试过来自非官方 Windows 二进制文件的 Python 扩展包的二进制安装程序:基础发行版可能包含 Fabric< /a>.

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

池予 2025-01-09 04:55:50

如果您使用的是 virtualenv,则需要在 Piotr Kochanski 的答案中添加一点:创建 virtualenv 时,允许它访问系统包,以便它可以看到 pycrypto。默认情况下它不允许这样做。

这些步骤对我有用:

  1. http://www.voidspace.org 安装 pycrpyto 二进制文件.uk/python/modules.shtml#pycrypto
  2. 创建一个可以访问系统包的虚拟环境。例如:

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

  3. pip install 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

暗喜 2025-01-09 04:55:50

1.创建一个virtualenv(我通常把所有的都放在桌面上)

2.下载pycrypto的二进制文件(与您安装的python版本和架构相匹配 - 目前不支持python3) - http://www.voidspace.org.uk/python/modules.shtml

3.导航到 easy_install 可执行文件(在Lib\site-packages)在您创建的 virtualenv 文件夹中并运行 pycrypto 安装 - 'easy_install C:\path\to\the\download\pycrypto-2.6.win-amd64-py2.7.exe'

4.激活 virtualenv和“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'

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文