2009-12-16 99 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.