easy_install不能安装包

时间:2021-10-02 08:57:48

I'm trying to write a setup.py file for my python project:

我在写一个设置。我的python项目的py文件:

import os
from setuptools import setup, find_packages
here = os.path.abspath(os.path.dirname(__file__))

requires = [
        'requests',
        'simplejson',
        'logging',
        'rfc3987',
    ]

setup(name='xxxxxxx',
      version='0.1',
      description='xxxxxxx API',
      url='https://github.com/xxxxxxxx',
      packages=find_packages(),
      include_package_data=True,
      zip_safe=False,
      install_requires=requires,
      ) 

When I execute it I'm getting this error:

当我执行它时,我得到了这个错误:

Searching for rfc3987
Reading http://pypi.python.org/simple/rfc3987/
Best match: rfc3987 1.3.1
Downloading https://pypi.python.org/packages/source/r/rfc3987/rfc3987-1.3.1.tar.gz#md5=397b1c1cd8b934269e53a621d56d9ed2
Processing rfc3987-1.3.1.tar.gz
Running rfc3987-1.3.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-AYV_bv/rfc3987-1.3.1/egg-dist-tmp-G8Kbay
Traceback (most recent call last):
  File "/usr/bin/easy_install", line 9, in <module>
    load_entry_point('distribute==0.6.10', 'console_scripts', 'easy_install')()
  File "/usr/lib/python2.6/site-packages/setuptools/command/easy_install.py", line 1715, in main
    with_ei_usage(lambda:
  File "/usr/lib/python2.6/site-packages/setuptools/command/easy_install.py", line 1696, in with_ei_usage
    return f()
  File "/usr/lib/python2.6/site-packages/setuptools/command/easy_install.py", line 1719, in <lambda>
    distclass=DistributionWithoutHelpCommands, **kw
  File "/usr/lib64/python2.6/distutils/core.py", line 152, in setup
    dist.run_commands()
  File "/usr/lib64/python2.6/distutils/dist.py", line 975, in run_commands
    self.run_command(cmd)
  File "/usr/lib64/python2.6/distutils/dist.py", line 995, in run_command
    cmd_obj.run()
  File "/usr/lib/python2.6/site-packages/setuptools/command/easy_install.py", line 236, in run
    self.easy_install(spec, not self.no_deps)
  File "/usr/lib/python2.6/site-packages/setuptools/command/easy_install.py", line 472, in easy_install
    return self.install_item(spec, dist.location, tmpdir, deps)
  File "/usr/lib/python2.6/site-packages/setuptools/command/easy_install.py", line 502, in install_item
    dists = self.install_eggs(spec, download, tmpdir)
  File "/usr/lib/python2.6/site-packages/setuptools/command/easy_install.py", line 681, in install_eggs
    return self.build_and_install(setup_script, setup_base)
  File "/usr/lib/python2.6/site-packages/setuptools/command/easy_install.py", line 958, in build_and_install
    self.run_setup(setup_script, setup_base, args)
  File "/usr/lib/python2.6/site-packages/setuptools/command/easy_install.py", line 947, in run_setup
    run_setup(setup_script, args)
  File "/usr/lib/python2.6/site-packages/setuptools/sandbox.py", line 29, in run_setup
    lambda: execfile(
  File "/usr/lib/python2.6/site-packages/setuptools/sandbox.py", line 70, in run
    return func()
  File "/usr/lib/python2.6/site-packages/setuptools/sandbox.py", line 31, in <lambda>
    {'__file__':setup_script, '__name__':'__main__'}
  File "setup.py", line 4, in <module>

  File "/tmp/easy_install-AYV_bv/rfc3987-1.3.1/rfc3987.py", line 324, in <module>
  File "/tmp/easy_install-AYV_bv/rfc3987-1.3.1/rfc3987.py", line 323, in <genexpr>
  File "/tmp/easy_install-AYV_bv/rfc3987-1.3.1/rfc3987.py", line 319, in _interpret_unicode_escapes
ValueError: zero length field name in format

If I try just easy_install rfc3987 I'm getting the same error.

如果我只尝试easy_install rfc3987,就会得到相同的错误。

Are there any ways to go around this?

有办法绕过这个问题吗?

1 个解决方案

#1


1  

rfc3987 claims that it works on Python 2.7 and 3.x. You're trying to install it on 2.6. So it fails.

rfc3987声称它适用于Python 2.7和3.x。你试图在2.6版本上安装它。所以它失败。

The problem has nothing to do with your own package, or with easy_install. If you download the tarball manually and run python2.6 setup.py install, you get the same error. And in fact, at least in 1.3.1, there's code that clearly isn't legal under Python 2.6, like this function.

这个问题与您自己的包或easy_install无关。如果您手动下载tarball并运行python2.6设置。py安装,您会得到相同的错误。实际上,至少在1。3.1中,有一些代码在Python 2.6中显然是不合法的,比如这个函数。


From the git history, it looks like there have been changes to make it Python 2.6 compatible, so the next release may work. Until then, you won't be able to use it from 2.6.

从git的历史来看,似乎已经发生了一些更改,使其与Python 2.6兼容,因此下一个版本可能会起作用。在那之前,你不能从2.6版本中使用它。

#1


1  

rfc3987 claims that it works on Python 2.7 and 3.x. You're trying to install it on 2.6. So it fails.

rfc3987声称它适用于Python 2.7和3.x。你试图在2.6版本上安装它。所以它失败。

The problem has nothing to do with your own package, or with easy_install. If you download the tarball manually and run python2.6 setup.py install, you get the same error. And in fact, at least in 1.3.1, there's code that clearly isn't legal under Python 2.6, like this function.

这个问题与您自己的包或easy_install无关。如果您手动下载tarball并运行python2.6设置。py安装,您会得到相同的错误。实际上,至少在1。3.1中,有一些代码在Python 2.6中显然是不合法的,比如这个函数。


From the git history, it looks like there have been changes to make it Python 2.6 compatible, so the next release may work. Until then, you won't be able to use it from 2.6.

从git的历史来看,似乎已经发生了一些更改,使其与Python 2.6兼容,因此下一个版本可能会起作用。在那之前,你不能从2.6版本中使用它。