代码之家  ›  专栏  ›  技术社区  ›  Jonathan Holloway

在Windows上安装结构(错误:没有名为Readline的模块)

  •  3
  • Jonathan Holloway  · 技术社区  · 15 年前

    我正试着使用 织物0.1.1 http://docs.fabfile.org/ 阅读线 模块。我经历了各种各样的问题,但似乎无法解决这个问题。这很重要,因为我们无法从基于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'
    

    6 回复  |  直到 15 年前
        1
  •  4
  •   Ned Deily    15 年前

    这个 readline easy_install 适用于OSX,而不是windows。有一些与Windows兼容的readline替代品,但也许您应该首先尝试更新 fabric 将其自身转换为更新的版本( 0.9

    对0.9版本的源进行Grepping时,在上找不到任何依赖项 阅读线

        2
  •  4
  •   Scott    11 年前

    以下这些步骤对我来说非常有效:

    1) 使用 MSI installer here

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

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

    Advanced system settings>Environment Variables>Path

    5) 下载 distribute_setup.py 从…起 here 进入C:\Python27\Scripts

    6) 打开命令行,导航到C:\Python27\Scripts,运行:“python distribute\u setup.py”

    7) 现在运行“轻松安装pip”

    Windows binary 从…起 here . 运行此命令以安装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.
    
        3
  •  2
  •   Rigsby    15 年前

    给这个 readline 试试看。它是一个适用于Windows的模块,允许IPython中的其他非本机功能以及可能与您尝试执行的操作配合使用的功能。

        4
  •  2
  •   Sridhar Ratnakumar    13 年前

    Fabric 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
    
        5
  •  1
  •   Pierre-Jean Coudert    14 年前
    1. 从下载并运行适用于python版本的easy_install installer http://pypi.python.org/pypi/setuptools#downloads . 即: setuptools-0.6c11.win32-py2.6.exe
    2. easy_install -U fabric 安装最后一个 织物
        6
  •  0
  •   pestilence669    15 年前

    如果您想将整个堆栈移向那个方向,那么Cygwin应该可以使用Readline。