使用"pip"更新pyOpenSSL和pandas失败,并显示"TypeError:resolve()得到了意外的关键字参数"replace_conflicting"". [英] Updates of pyOpenSSL and pandas using 'pip' fail with "TypeError: resolve() got an unexpected keyword argument 'replace_conflicting'"

查看:127
本文介绍了使用"pip"更新pyOpenSSL和pandas失败,并显示"TypeError:resolve()得到了意外的关键字参数"replace_conflicting"".的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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; Python 2.7.5; setuptools 3.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)

这也是我在虚拟环境中运行测试时得到的.

解决方案

一个可能的原因是存在多个版本setuptools的版本,在Python路径上的较早版本比较新的版本早.可以通过以

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 

开始对pip的调用来暂时克服此问题.

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


您可以通过执行

确认是这种情况

import pkg_resources
pkg_resources.__file__

在Python中,请注意,返回的pkg_resources.pyc在当前站点包的位置中为 not .

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

When I attempt to update or install any version of pandas or pyOpenSSL(with any instance of sudo pip --[un]install|update [--no-use-wheel] [pandas|pyOpenSSL|xattr|stevedore], using pip 1.5.4) I get:

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'

Why am I getting this error and what can I do to avoid it?


OSX 10.9.2; Python 2.7.5; setuptools 3.4.3.

More detail on the error report (for 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'

Contents of /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, I can install pandas successfully in a virtual environment. If I copy it from there back into the environment where I get this error and run nosetests pandas I get:

..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)

This is also what I get if I run the tests in the virtual environment.

解决方案

A likely cause is the presence of multiple versions of setuptools, with an older version earlier on the Python path than the newer one. This can be temporarily overcome for the purposes of installation by beginning your invocations of pip with

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


You can confirm that this is the case by executing

import pkg_resources
pkg_resources.__file__

in Python and noting that the pkg_resources.pyc returned is not in the location of your current site packages.

In some cases this can also be corrected by ensuring that the pkg_resources.pyc in your site packages directory in executed, rather than the one in your system packages directory (e.g., by deleting the latter).

这篇关于使用"pip"更新pyOpenSSL和pandas失败,并显示"TypeError:resolve()得到了意外的关键字参数"replace_conflicting"".的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆