python - 在 Windows 上安装 Fabric(错误 No Module Named Readline)

标签 python windows deployment fabric

我正在尝试在 Windows 上使用 Fabric 0.1.1 部署工具 ( http://docs.fabfile.org/ ),但我们遇到了 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'

有没有人解决了这个问题或者有人可以提出解决方法?

最佳答案

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

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

关于python - 在 Windows 上安装 Fabric(错误 No Module Named Readline),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1917193/

相关文章:

Python mysql 包未运行 REPLACE 语句

python - 画n个相同的圆,不重叠,不重心

python - python子进程在交互模式下工作,但不在脚本中工作

iis-7 - 如何在Windows 2003/IIS 6上设置Web Deploy?

svn - Subversion + 同一个工作副本中的其他一些 VCS(Git、Hg 等)

python - 来自 Pandas Dataframe 的 Fishers 精确测试

python - Lru_cache(来自 functools)如何工作?

c++ - 64 位 exe 在 vi​​sual studio 外崩溃但在 visual studio 内工作

c++ - 使用 C++ 的 CPU ID - Windows

c# - 如何向 ClickOnce 应用程序添加先决条件?