在 Windows 上安装 Fabric(错误 No Module Called Readline)

发布于 2024-08-15 22:23:33 字数 3494 浏览 5 评论 0 原文

我正在尝试使用 Fabric 0.1.1 部署工具 (http://docs. fabfile.org/)在 Windows 上,我们遇到了 readline 模块的问题。我经历过各种线程,但似乎无法解决问题。这很重要,因为我们无法从基于 Windows 的计算机部署应用程序。

C:\Documents and Settings\dev\Desktop\deploy>fab
Traceback (most recent call last):
  File "C:\python\Scripts\fab-script.py", line 8, in <module>
    load_entry_point('fabric==0.1.1', 'console_scripts', 'fab')()
  File "c:\python\lib\site-packages\setuptools-0.6c9-py2.6.egg\pkg_resources.py"
, line 277, in load_entry_point
  File "c:\python\lib\site-packages\setuptools-0.6c9-py2.6.egg\pkg_resources.py"
, line 2180, in load_entry_point
  File "c:\python\lib\site-packages\setuptools-0.6c9-py2.6.egg\pkg_resources.py"
, line 1913, in load
  File "build\bdist.win32\egg\fabric.py", line 25, in <module>
**ImportError: No module named readline**

安装模块的结果是:

**easy_install readline**
Searching for readline
Reading http://pypi.python.org/simple/readline/
Reading http://www.python.org/
Best match: readline 2.6.4
Downloading http://pypi.python.org/packages/source/r/readline/readline-2.6.4.tar
.gz#md5=7568e8b78f383443ba57c9afec6f4285
Processing readline-2.6.4.tar.gz
Running readline-2.6.4\setup.py -q bdist_egg --dist-dir c:\docume~1\ji81b9~1.che
\locals~1\temp\easy_install-pzkz1a\readline-2.6.4\egg-dist-tmp-szs2ps
Traceback (most recent call last):
  File "C:\python\Scripts\easy_install-script.py", line 8, in <module>
    load_entry_point('setuptools==0.6c9', 'console_scripts', 'easy_install')()
  File "c:\python\lib\site-packages\setuptools-0.6c9-py2.6.egg\setuptools\comman
d\easy_install.py", line 1671, in main
  File "c:\python\lib\site-packages\setuptools-0.6c9-py2.6.egg\setuptools\comman
d\easy_install.py", line 1659, in with_ei_usage
  File "c:\python\lib\site-packages\setuptools-0.6c9-py2.6.egg\setuptools\comman
d\easy_install.py", line 1675, in <lambda>
  File "c:\python\lib\distutils\core.py", line 152, in setup
    dist.run_commands()
  File "c:\python\lib\distutils\dist.py", line 975, in run_commands
    self.run_command(cmd)
  File "c:\python\lib\distutils\dist.py", line 995, in run_command
    cmd_obj.run()
  File "c:\python\lib\site-packages\setuptools-0.6c9-py2.6.egg\setuptools\comman
d\easy_install.py", line 211, in run
  File "c:\python\lib\site-packages\setuptools-0.6c9-py2.6.egg\setuptools\comman
d\easy_install.py", line 446, in easy_install
  File "c:\python\lib\site-packages\setuptools-0.6c9-py2.6.egg\setuptools\comman
d\easy_install.py", line 476, in install_item
  File "c:\python\lib\site-packages\setuptools-0.6c9-py2.6.egg\setuptools\comman
d\easy_install.py", line 655, in install_eggs
  File "c:\python\lib\site-packages\setuptools-0.6c9-py2.6.egg\setuptools\comman
d\easy_install.py", line 930, in build_and_install
  File "c:\python\lib\site-packages\setuptools-0.6c9-py2.6.egg\setuptools\comman
d\easy_install.py", line 919, in run_setup
  File "c:\python\lib\site-packages\setuptools-0.6c9-py2.6.egg\setuptools\sandbo
x.py", line 27, in run_setup
  File "c:\python\lib\site-packages\setuptools-0.6c9-py2.6.egg\setuptools\sandbo
x.py", line 63, in run
  File "c:\python\lib\site-packages\setuptools-0.6c9-py2.6.egg\setuptools\sandbo
x.py", line 29, in <lambda>
  File "setup.py", line 93, in <module>
AttributeError: 'module' object has no attribute 'symlink'

有人解决了这个问题吗?或者有人可以建议解决方法吗?

I'm trying to use the Fabric 0.1.1 deploy tool (http://docs.fabfile.org/) on Windows and we're running into an issue with the readline module. I've been through various threads but can't seem to solve the issue. It's important because we can't deploy applications from Windows based machines.

C:\Documents and Settings\dev\Desktop\deploy>fab
Traceback (most recent call last):
  File "C:\python\Scripts\fab-script.py", line 8, in <module>
    load_entry_point('fabric==0.1.1', 'console_scripts', 'fab')()
  File "c:\python\lib\site-packages\setuptools-0.6c9-py2.6.egg\pkg_resources.py"
, line 277, in load_entry_point
  File "c:\python\lib\site-packages\setuptools-0.6c9-py2.6.egg\pkg_resources.py"
, line 2180, in load_entry_point
  File "c:\python\lib\site-packages\setuptools-0.6c9-py2.6.egg\pkg_resources.py"
, line 1913, in load
  File "build\bdist.win32\egg\fabric.py", line 25, in <module>
**ImportError: No module named readline**

Installing the module results in:

**easy_install readline**
Searching for readline
Reading http://pypi.python.org/simple/readline/
Reading http://www.python.org/
Best match: readline 2.6.4
Downloading http://pypi.python.org/packages/source/r/readline/readline-2.6.4.tar
.gz#md5=7568e8b78f383443ba57c9afec6f4285
Processing readline-2.6.4.tar.gz
Running readline-2.6.4\setup.py -q bdist_egg --dist-dir c:\docume~1\ji81b9~1.che
\locals~1\temp\easy_install-pzkz1a\readline-2.6.4\egg-dist-tmp-szs2ps
Traceback (most recent call last):
  File "C:\python\Scripts\easy_install-script.py", line 8, in <module>
    load_entry_point('setuptools==0.6c9', 'console_scripts', 'easy_install')()
  File "c:\python\lib\site-packages\setuptools-0.6c9-py2.6.egg\setuptools\comman
d\easy_install.py", line 1671, in main
  File "c:\python\lib\site-packages\setuptools-0.6c9-py2.6.egg\setuptools\comman
d\easy_install.py", line 1659, in with_ei_usage
  File "c:\python\lib\site-packages\setuptools-0.6c9-py2.6.egg\setuptools\comman
d\easy_install.py", line 1675, in <lambda>
  File "c:\python\lib\distutils\core.py", line 152, in setup
    dist.run_commands()
  File "c:\python\lib\distutils\dist.py", line 975, in run_commands
    self.run_command(cmd)
  File "c:\python\lib\distutils\dist.py", line 995, in run_command
    cmd_obj.run()
  File "c:\python\lib\site-packages\setuptools-0.6c9-py2.6.egg\setuptools\comman
d\easy_install.py", line 211, in run
  File "c:\python\lib\site-packages\setuptools-0.6c9-py2.6.egg\setuptools\comman
d\easy_install.py", line 446, in easy_install
  File "c:\python\lib\site-packages\setuptools-0.6c9-py2.6.egg\setuptools\comman
d\easy_install.py", line 476, in install_item
  File "c:\python\lib\site-packages\setuptools-0.6c9-py2.6.egg\setuptools\comman
d\easy_install.py", line 655, in install_eggs
  File "c:\python\lib\site-packages\setuptools-0.6c9-py2.6.egg\setuptools\comman
d\easy_install.py", line 930, in build_and_install
  File "c:\python\lib\site-packages\setuptools-0.6c9-py2.6.egg\setuptools\comman
d\easy_install.py", line 919, in run_setup
  File "c:\python\lib\site-packages\setuptools-0.6c9-py2.6.egg\setuptools\sandbo
x.py", line 27, in run_setup
  File "c:\python\lib\site-packages\setuptools-0.6c9-py2.6.egg\setuptools\sandbo
x.py", line 63, in run
  File "c:\python\lib\site-packages\setuptools-0.6c9-py2.6.egg\setuptools\sandbo
x.py", line 29, in <lambda>
  File "setup.py", line 93, in <module>
AttributeError: 'module' object has no attribute 'symlink'

Has anybody solved this issue or can anybody suggest a workaround?

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

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

发布评论

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

评论(6

[旋木] 2024-08-22 22:23:33

您尝试使用 easy_install 安装的 readline 模块适用于 OS X,而不是 Windows。有与 Windows 兼容的 readline 替代品,但也许您应该首先尝试将 fabric 本身更新到更新的版本 (0.9 现已发布)。

grep 0.9版本的源码没有发现任何对readline的依赖。

The readline module you are trying to install with easy_install is for OS X, not windows. There are Windows-compatible replacements for readline out there but perhaps you should first try updating fabric itself to a more current version (0.9 is out there now).

Grepping the source of the 0.9 version does not find any dependencies on readline.

度的依靠╰つ 2024-08-22 22:23:33

遵循这些步骤对我来说完全有效:

1)使用 适用于 x86 的 MSI 安装程序,来自此处

2)安装在默认的C:\Python27目录下。

3) 创建新目录:C:\Python27\Scripts

4) 将 C:\Python27 和 C:\Python27\Scripts 添加到系统路径:

高级系统设置>环境变量>路径

5) 下载distribute_setup.py此处 进入 C:\Python27\Scripts

6) 打开命令行,导航到 C :\Python27\Scripts, 运行: 'python allocate_setup.py'

7) 现在运行 'easy_install pip'

8) 现在运行 'pip install Fabric'

9) 您应该收到一条错误消息,指出 PyCrypto 无法安装。您可以下载预构建 Windows 二进制文件< /a> 来自此处。运行此命令来安装 PyCrypto。

10) 再次运行“pip install Fabric”,它应该表明一切都已安装。

11) 在另一个目录(假设为 c:\dev\hello)中创建一个 fabfile.py 并添加以下代码:

def hello(name="world"):
    print("Hello %s!" % name)

12) cd 到该目录并运行“fab hello:working”。你应该看到输出说

Hello working!

Done.

Following these steps exactly worked for me:

1) Installed using the MSI installer for x86 from here.

2) Installed in the default C:\Python27 directory.

3) Create a new directory: C:\Python27\Scripts

4) Added C:\Python27 and C:\Python27\Scripts to the system path:

Advanced system settings>Environment Variables>Path

5) Download the distribute_setup.py from here into C:\Python27\Scripts

6) Open a command line, navigate to C:\Python27\Scripts, run: 'python distribute_setup.py'

7) now run 'easy_install pip'

8) now run 'pip install fabric'

9) You should get an error saying PyCrypto couldn't install. You can download the pre-build Windows binary from here. Run this to install PyCrypto.

10) run 'pip install fabric' again and it should say everything is installed.

11) in a different directory (let's say c:\dev\hello) create a fabfile.py and add the following code:

def hello(name="world"):
    print("Hello %s!" % name)

12) cd to this directory and run 'fab hello:working'. You should see output say

Hello working!

Done.
ぃ弥猫深巷。 2024-08-22 22:23:33

尝试一下这个 readline 。它是一个适用于 Windows 的模块,允许 IPython 中非本机的附加功能,并且可能适合您尝试执行的操作。

Give this readline a try. It is a module for Windows that allows additional features in IPython that aren't native and might work with what you are trying to do.

温柔戏命师 2024-08-22 22:23:33

我相信 0.1.1 是一个旧版本。我在 Windows 上使用 Fabric 没有问题.activestate.com/activepython/" rel="nofollow noreferrer">ActivePython (带有 PyPM< /a>):

C:\> pypm install fabric
Ready to perform these actions:
The following packages will be installed:
 fabric-0.9.0 pycrypto-2.0.1
Get: [pypm.activestate.com] fabric 0.9.0-1
Get: [pypm.activestate.com] pycrypto 2.0.1-1
Installing fabric-0.9.0
Fixing script C:\Users\sridharr\AppData\Roaming\Python\Scripts\fab-script.py
Installing pycrypto-2.0.1

0.1.1 is an older version, I believe. I have no problem installing Fabric on Windows with ActivePython (w/ PyPM):

C:\> pypm install fabric
Ready to perform these actions:
The following packages will be installed:
 fabric-0.9.0 pycrypto-2.0.1
Get: [pypm.activestate.com] fabric 0.9.0-1
Get: [pypm.activestate.com] pycrypto 2.0.1-1
Installing fabric-0.9.0
Fixing script C:\Users\sridharr\AppData\Roaming\Python\Scripts\fab-script.py
Installing pycrypto-2.0.1
祁梦 2024-08-22 22:23:33
  1. http://pypi.python.org/pypi/ 下载并运行适用于您的 python 版本的 easy_install 安装程序setuptools#downloads 。即:setuptools-0.6c11.win32-py2.6.exe
  2. 在命令提示符下,启动easy_install -U Fabric来安装最后一个fabric发布。
  1. Download and run easy_install installer for your python version from http://pypi.python.org/pypi/setuptools#downloads . ie: setuptools-0.6c11.win32-py2.6.exe
  2. On the command prompt, lauch easy_install -U fabric to install the last fabric release.
梦中楼上月下 2024-08-22 22:23:33

如果您想将整个堆栈朝该方向移动,Readline 应该可用于 Cygwin。

Readline should be available with Cygwin, if you want to move your entire stack in that direction.

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