2009-12-16 111 views
3

我试图在Windows上使用面料0.1.1部署工具(http://docs.fabfile.org/),我们正在运行与的readline模块的问题。我已经通过各种线程,但似乎无法解决问题。这很重要,因为我们无法从基于Windows的计算机部署应用程序。安装布在Windows(错误无模块调用的ReadLine)

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' 

有没有人解决了这个问题,或者有谁能够提出一个解决办法?

+0

我在Windows上工作,但使用cygwin包括python,fabric和git进行版本控制和部署。绝对没有麻烦,效果很好。 您只需更改fabric/base.py并将win32api中的值“cygwin”删除即可。但除了那个小错误,它的工作非常顺利 – robertnl 2010-01-30 19:57:06

回答

4

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

对0.9版本的来源进行细化并没有发现对readline的任何依赖关系。

+0

这是我的第一个想法,但有关如何通过easy_install安装的想法?我认为这可能是下载源代码并通过cygwin编译的情况... – Jon 2009-12-16 21:21:29

+0

尝试'easy_install -U fabric'以获取最新版本。 – 2009-12-16 21:35:01

+1

太棒了,谢谢。我从零开始重新开始使用Fabric 0.9,并写下了我在Windows上安装的步骤:http://blog.oogly.co.uk/builddeploy/installing-and-running-fabric-on-windows – Jon 2009-12-17 04:22:11

0

如果您希望将整个堆栈向该方向移动,则应在Cygwin中提供Readline。

2

给这个readline一试。它是Windows的一个模块,允许IPython中的其他功能不是本机的,并可能与您正在尝试的功能一起工作。

+0

对于readline问题,但...我遇到了一个win32模块错误(我也通过安装pywin32来修复)。然而,现在我坚持paramiko SSH异常 - paramiko.SSHException:没有合适的地址家庭的xxxx – Jon 2009-12-16 21:19:13

2

0.1.1是旧版本,我相信。我没有问题,在Windows上安装FabricActivePython(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 
+1

如果这个工作(我还没有尝试过 - 我解决了基本的python安装),你真的应该联系织物并确保他们在他们的安装说明中添加备注 - 这将有助于为人们节省大量时间。 – Jon 2009-12-21 19:46:45

+0

乔恩,我在他们的问题跟踪器中提出了一个请求:http://code.fabfile.org/issues/show/127 – 2009-12-28 03:40:04

+0

真棒,谢谢。我相信这会帮助很多人处于相同的状况 – Jon 2009-12-29 23:50:40

4

按照这些步骤正是为我工作:使用MSI installer针对x86从here安装

1)。

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

3)创建一个新目录:C:\ Python27 \脚本

4)添加C:\ Python27和C:\ Python27 \脚本到系统路径:

Advanced system settings>Environment Variables>Path

5 )将distribute_setup.pyhere下载到C:\ Python27 \ Scripts

6)打开命令行,导航到C:\ Python27 \ Scripts,运行:'python distribute_setup。PY”

7)现在运行 '的easy_install点子'

8)现在运行 'PIP安装布'

9)你应该得到一个错误,说PyCrypto无法安装。您可以从here下载预生成Windows binary。运行它来安装PyCrypto。

10)再次运行'pip install fabric',应该说所有的东西都安装好了。

11)在不同目录中(假设C:\ dev的\你好)创建fabfile.py并添加以下代码:

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

12)cd到该目录,然后运行“FAB你好:加工'。你应该看到输出说

Hello working! 

Done.