views:

869

answers:

5

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?

+2  A: 

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.

Ned Deily
This was my first idea, but any ideas on how this is installed via easy_install? I think it might be a case of download the source and compile via cygwin...
Jon
Try `easy_install -U fabric` to get the latest version.
Ned Deily
Awesome, thanks. I started again from scratch with Fabric 0.9 and wrote up the steps that I took to install on Windows here: http://blog.oogly.co.uk/builddeploy/installing-and-running-fabric-on-windows
Jon
A: 

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

Pestilence
+2  A: 

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.

Rigsby
That worked for the readline issue but... I ran into a win32 module error (which I also fixed by installing pywin32). However, now I'm stuck with a paramiko SSH exception - paramiko.SSHException: No suitable address family for x.x.x.x
Jon
+1  A: 

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
Sridhar Ratnakumar
If this does work (I haven't tried it - I fixed up the base python install) you really should contact the Fabric guys and make sure they add a note to their installation instructions - would help to save people lots of time.
Jon
Jon, I made a request in their issue tracker: http://code.fabfile.org/issues/show/127
Sridhar Ratnakumar
Awesome, thanks. I'm sure that will help a lot of people in the same situation...
Jon
+1  A: 
  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.
Pierre-Jean Coudert