python - 尝试在 linux 中安装 fabric 时出现 fabric(python 模块)错误

标签 python linux deployment fabric python-2.4

我是 fabric 工具的新手,我已经在使用 python 了。 当我尝试通过 easy_install 安装 fabric 时,出现以下语法错误。

我没有更改我的脚本中的任何内容,我正在通过结构代码下载并尝试通过简单安装进行安装:

请检查以下错误,并给出我将如何进一步处理的建议。

[root@ ~]$ easy_install setup
Searching for setup
Reading https://pypi.python.org/simple/setup/
Couldn't find index page for 'setup' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading https://pypi.python.org/simple/
No local packages or download links found for setup
error: Could not find suitable distribution for Requirement.parse('setup')
[root@cmcibv12 addr:113.128.177.237 ~]$ easy_install fabric
Searching for fabric
Reading https://pypi.python.org/simple/fabric/
Best match: Fabric 1.8.0
Downloading https://pypi.python.org/packages/source/F/Fabric/Fabric-1.8.0.tar.gz#md5=1f195d16b05877767816617749d33eca
Processing Fabric-1.8.0.tar.gz
Writing /tmp/easy_install-PoxSe1/Fabric-1.8.0/setup.cfg
Running Fabric-1.8.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-PoxSe1/Fabric-1.8.0/egg-dist-tmp-JzsXHn
Traceback (most recent call last):
  File "/usr/bin/easy_install", line 8, in ?
    sys.exit(
  File "/usr/lib/python2.4/site-packages/setuptools-1.1.7-py2.4.egg/setuptools/command/easy_install.py", line 1925, in main
    with_ei_usage(lambda:
  File "/usr/lib/python2.4/site-packages/setuptools-1.1.7-py2.4.egg/setuptools/command/easy_install.py", line 1912, in with_ei_usage
    return f()
  File "/usr/lib/python2.4/site-packages/setuptools-1.1.7-py2.4.egg/setuptools/command/easy_install.py", line 1929, in <lambda>
    distclass=DistributionWithoutHelpCommands, **kw
  File "/usr/lib64/python2.4/distutils/core.py", line 149, in setup
    dist.run_commands()
  File "/usr/lib64/python2.4/distutils/dist.py", line 946, in run_commands
    self.run_command(cmd)
  File "/usr/lib64/python2.4/distutils/dist.py", line 966, in run_command
    cmd_obj.run()
  File "/usr/lib/python2.4/site-packages/setuptools-1.1.7-py2.4.egg/setuptools/command/easy_install.py", line 374, in run
    self.easy_install(spec, not self.no_deps)
  File "/usr/lib/python2.4/site-packages/setuptools-1.1.7-py2.4.egg/setuptools/command/easy_install.py", line 609, in easy_install
    return self.install_item(spec, dist.location, tmpdir, deps)
  File "/usr/lib/python2.4/site-packages/setuptools-1.1.7-py2.4.egg/setuptools/command/easy_install.py", line 639, in install_item
    dists = self.install_eggs(spec, download, tmpdir)
  File "/usr/lib/python2.4/site-packages/setuptools-1.1.7-py2.4.egg/setuptools/command/easy_install.py", line 825, in install_eggs
    return self.build_and_install(setup_script, setup_base)
  File "/usr/lib/python2.4/site-packages/setuptools-1.1.7-py2.4.egg/setuptools/command/easy_install.py", line 1031, in build_and_install
    self.run_setup(setup_script, setup_base, args)
  File "/usr/lib/python2.4/site-packages/setuptools-1.1.7-py2.4.egg/setuptools/command/easy_install.py", line 1016, in run_setup
    run_setup(setup_script, args)
  File "/usr/lib/python2.4/site-packages/setuptools-1.1.7-py2.4.egg/setuptools/sandbox.py", line 68, in run_setup
    DirectorySandbox(setup_dir).run(
  File "/usr/lib/python2.4/site-packages/setuptools-1.1.7-py2.4.egg/setuptools/sandbox.py", line 120, in run
    return func()
  File "/usr/lib/python2.4/site-packages/setuptools-1.1.7-py2.4.egg/setuptools/sandbox.py", line 71, in <lambda>
    {'__file__':setup_script, '__name__':'__main__'}
  File "setup.py", line 7, in ?
  File "/tmp/easy_install-PoxSe1/Fabric-1.8.0/fabric/version.py", line 57
    sha1 = (" (%s)" % sha) if sha else ""
                            ^
SyntaxError: invalid syntax

提前致谢。

最佳答案

Fabric 需要 Python 2.5 或更高版本,而您使用的是 2.4。参见 official docs

We are not planning on supporting Python 2.4 given its age and the number of useful tools in Python 2.5 such as context managers and new modules. That said, the actual amount of 2.5-specific functionality is not prohibitively large, and we would link to – but not support – a third-party 2.4-compatible fork. (No such fork exists at this time, to our knowledge.)

关于python - 尝试在 linux 中安装 fabric 时出现 fabric(python 模块)错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19721675/

相关文章:

deployment - 在 JBoss 7 中配置 JDBC 驱动程序 - 作为部署还是作为模块?

python - 这是什么意思?

python - “An expression that has one of two values, depending on a condition.” 是条件表达式的准确定义吗?

python - SymPy `solve` 无法求解矩阵方程 A*x = b 当符号被替换为 `subs` 的值时

linux - 将 bash 表达式传递给 AWK 以进行浮点运算

deployment - 使用 TeamCity,如何针对先前构建和测试的构建运行手动触发 DEPLOY?

python - 查找 Python 进程及其所有子进程使用的总内存

用于搜索和删除格式为 mm/dd/yyy 的今天日期的 Linux shell 脚本

regex - 删除linux中第二个重复指定字符前的数据

java - 请求的资源在 Servlet、Tomcat7 中不可用