gpt4 book ai didi

python - 使用 'pip' 更新 pyOpenSSL 和 pandas 失败,出现 "TypeError: resolve() got an unexpected keyword argument ' replace_conflicting'"

转载 作者:行者123 更新时间:2023-11-28 19:29:37 27 4
gpt4 key购买 nike

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

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'

为什么会出现此错误,我该如何避免?


操作系统 10.9.2; Python 2.7.5; 设置工具 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)

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

最佳答案

A likely cause setuptools 存在多个版本,Python 路径上的旧版本比新版本早。为了安装目的,可以通过开始调用 pip 来暂时克服此问题

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

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

import pkg_resources
pkg_resources.__file__

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

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

关于python - 使用 'pip' 更新 pyOpenSSL 和 pandas 失败,出现 "TypeError: resolve() got an unexpected keyword argument ' replace_conflicting'",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21678394/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com