在 Windows 7 上安装 Python Fabric 时出现问题
我正在尝试使用 在 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
有什么解决问题的建议吗?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我刚刚使用网络上各个地方的信息设法在 win7 盒子上安装了fabric。这真的很烦人,所以为了避免其他人沮丧,我整理了以下列表。
pip install Fabric
- 你会得到错误,一些关于丢失bat文件的东西,安装 pycrypto 时等。pip install Fabric - 这次一切似乎都正常,直到您尝试运行 Fabric 脚本。它会抱怨“没有名为 win32api 的模块”等。
你就完成了,布料应该可以正常工作。
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.
pip install fabric
- you'll get errors, some stuff about missing bat files, etc. while installing pycrypto.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.And you are done, fabric should work ok.
您是否尝试过来自非官方 Windows 二进制文件的 Python 扩展包的二进制安装程序:基础发行版可能包含 Fabric< /a>.
have you tried a binary installer from Unofficial Windows Binaries for Python Extension Packages: Base distribution may contain Fabric.
如果您使用的是 virtualenv,则需要在 Piotr Kochanski 的答案中添加一点:创建 virtualenv 时,允许它访问系统包,以便它可以看到 pycrypto。默认情况下它不允许这样做。
这些步骤对我有用:
创建一个可以访问系统包的虚拟环境。例如:
c:\Python27\Scripts\virtualenv.exe --system-site-packages c:\Proj\virtualenv
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:
Create a virtual env that can access the system packages. For example:
c:\Python27\Scripts\virtualenv.exe --system-site-packages c:\Proj\virtualenv
pip install fabric
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'