3

当我尝试更新或安装 or 的任何版本pandas(使用1.5.4pyOpenSSL的任何实例)时,我得到:sudo pip --[un]install|update [--no-use-wheel] [pandas|pyOpenSSL|xattr|stevedore]pip

Command python setup.py egg_info failed with error code 1 in /private/tmp/pip_build_root/pandas
Storing debug log for failure in /Users/Rax/Library/Logs/pip.log
...
TypeError: resolve() got an unexpected keyword argument 'replace_conflicting'

为什么我会收到此错误,我该怎么做才能避免它?


OSX 10.9.2;蟒蛇2.7.5;setuptools3.4.3.

有关错误报告的更多详细信息(对于pandas):

Downloading/unpacking pandas
  Downloading pandas-0.13.1.tar.gz (6.1MB): 6.1MB downloaded
  Running setup.py (path:/private/tmp/pip_build_root/pandas/setup.py) egg_info for package pandas
    Traceback (most recent call last):
      File "<string>", line 17, in <module>
      File "/private/tmp/pip_build_root/pandas/setup.py", line 590, in <module>
        **setuptools_kwargs)
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 112, in setup
        _setup_distribution = dist = klass(attrs)
      File "/Library/Python/2.7/site-packages/setuptools/dist.py", line 239, in __init__
        self.fetch_build_eggs(attrs.pop('setup_requires'))
      File "/Library/Python/2.7/site-packages/setuptools/dist.py", line 264, in fetch_build_eggs
        replace_conflicting=True
    TypeError: resolve() got an unexpected keyword argument 'replace_conflicting'
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):

  File "<string>", line 17, in <module>

  File "/private/tmp/pip_build_root/pandas/setup.py", line 590, in <module>

    **setuptools_kwargs)

  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 112, in setup

    _setup_distribution = dist = klass(attrs)

  File "/Library/Python/2.7/site-packages/setuptools/dist.py", line 239, in __init__

    self.fetch_build_eggs(attrs.pop('setup_requires'))

  File "/Library/Python/2.7/site-packages/setuptools/dist.py", line 264, in fetch_build_eggs

    replace_conflicting=True

TypeError: resolve() got an unexpected keyword argument 'replace_conflicting'

内容/Users/Rax/Library/Logs/pip.log

Exception information:
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/pip/basecommand.py", line 122, in main
    status = self.run(options, args)
  File "/Library/Python/2.7/site-packages/pip/commands/install.py", line 274, in run
    requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
  File "/Library/Python/2.7/site-packages/pip/req.py", line 1215, in prepare_files
    req_to_install.run_egg_info()
  File "/Library/Python/2.7/site-packages/pip/req.py", line 321, in run_egg_info
    command_desc='python setup.py egg_info')
  File "/Library/Python/2.7/site-packages/pip/util.py", line 697, in call_subprocess
    % (command_desc, proc.returncode, cwd))
InstallationError: Command python setup.py egg_info failed with error code 1 in /private/tmp/pip_build_root/pandas

Cython          - 0.20.1       - active 
Flask           - 0.10.1       - active 
Jinja2          - 2.7.2        - active 
MarkupSafe      - 0.19         - active 
PyRSS2Gen       - 1.1          - active 
Pygments        - 1.6          - active 
Python          - 2.7.5        - active development (/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload)
Sphinx          - 1.2.2        - active 
Twisted         - 13.2.0       - active 
Werkzeug        - 0.9.4        - active 
altgraph        - 0.11         - active 
astropy         - 0.3          - active 
backports.ssl-match-hostname - 3.4.0.2      - active 
bdist-mpkg      - 0.5.0        - active 
brewer2mpl      - 1.3.2        - active 
cffi            - 0.8.2        - active 
colorama        - 0.2.7        - active 
configobj       - 5.0.1        - active 
dill            - 0.2b1        - active 
distribute      - 0.7.3        - active 
docutils        - 0.11         - active 
ggplot          - 0.4.7        - active 
ipython         - 1.2.1        - active 
itsdangerous    - 0.23         - active 
macholib        - 1.6          - active 
matplotlib      - 1.3.1        - active 
modulegraph     - 0.11         - active 
mpltools        - 0.1          - active 
nose            - 1.3.0        - active 
numexpr         - 2.3.1        - active 
numpy           - 1.8.0        - active 
numpydoc        - 0.4          - active 
pandas          - 0.13.1       - active 
patsy           - 0.2.1        - active 
pika            - 0.9.13       - active 
pip             - 1.5.4        - active 
prettytable     - 0.7.2        - active 
progressbar     - 2.2          - active 
py2app          - 0.8          - active 
pycparser       - 2.10         - active 
pyparsing       - 2.0.1        - active 
python-dateutil - 2.2          - active 
pytz            - 2014.1.1     - active 
pyzmq           - 14.0.1       - active 
readline        - 6.2.4.1      - active 
rpy2            - 2.3.9        - active 
scikit-learn    - 0.14.1       - active 
scipy           - 0.13.3       - active 
setuptools      - 3.4.3        - active 
sphinx-argparse - 0.1.9        - active 
sphinxcontrib-napoleon - 0.2.6        - active 
sphinxcontrib-programoutput - 0.8          - active 
statsmodels     - 0.5.0        - active 
stevedore       - 0.14.1       - active 
sympy           - 0.7.5        - active 
tornado         - 3.2          - active 
virtualenv-clone - 0.2.4        - active 
virtualenv      - 1.11.4       - active 
virtualenvwrapper - 4.2          - active 
websocket-client - 0.12.0       - active 
wsgiref         - 0.1.2        - active development (/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7)
xattr           - 0.7.4        - active 
yhat            - 0.6.14       - active 
yolk            - 0.4.3        - active 
zope.interface  - 4.0.5        - active 

FWIW,我可以pandas在虚拟环境中成功安装。如果我将它从那里复制回出现此错误并运行的环境中,我会nosetests pandas得到:

..SS..SS..SS..SS/Library/Python/2.7/site-packages/pandas/core/index.py:910: RuntimeWarning: tp_compare didn't return -1 or -2 for exception
  result.sort()
..SS..SS..SS..SS..SSSSSSSSSS..SS..SS..SSSS.S.S...........SS..SS..SS..........................SSSSSSSSSS.SSSS.....SSSSSSSSSSSSSS.SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS.SSSS..................S.....S........................................................................................................................................................................................................................................................................SS......................................................................................................SSSS.......................SSS..............................................................................................................................................S.......................SSSSSSS...........................................................................................S......................................................................................................................................................S.........................................S..S..S....S........................................................S......S.S.......S...S..S............S............................................................................................................................................................................................S............................................................................S........................................./Library/Python/2.7/site-packages/numpy/core/_methods.py:55: RuntimeWarning: Mean of empty slice.
  warnings.warn("Mean of empty slice.", RuntimeWarning)
...................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................S...............................................
----------------------------------------------------------------------
Ran 4466 tests in 230.555s

OK (SKIP=330)

如果我在虚拟环境中运行测试,这也是我得到的。

4

2 回答 2

0

一个可能的原因是存在多个版本的setuptools,在 Python 路径上的旧版本比新版本早。这可以通过开始调用pipwith来暂时克服安装的目的

PYTHONPATH=/PATH_TO_YOUR_CURRENT_PACKAGES/site-packages pip ...

您可以通过执行来确认是这种情况

import pkg_resources
pkg_resources.__file__

在 Python 中并注意pkg_resources.pyc返回的不在您当前站点包的位置。

在某些情况下,这也可以通过确保pkg_resources.pyc在您的站点包目录中执行,而不是在您的系统包目录中执行(例如,通过删除后者)来纠正。

于 2014-06-11T17:32:41.670 回答
-1

如果你在 OSX 上,我认为避免出现类似错误的最简单解决方案是使用Homebrew来管理 Python、pip 和 pandas 等库的安装。

如果您已经在使用 Homebrew(您的问题不清楚)。试试运行brew doctor看看有没有报错。

pip与 Homebrew 协同工作:

  • ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"安装自制软件。

  • brew doctor并确保运行此命令没有错误。遵循它的建议,特别是关于$PATH环境变量。

  • brew install python安装 Python 2.7(和 pip)

  • pip install pandas

于 2014-02-22T12:15:49.143 回答