首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >PIP无法升级setuptools

PIP无法升级setuptools
EN

Stack Overflow用户
提问于 2016-06-18 02:17:20
回答 1查看 2.7K关注 0票数 3

我试图升级CentOS 6上的setuptools并遇到以下问题:

代码语言:javascript
复制
$ sudo pip install setuptools --no-use-wheel --upgrade
DEPRECATION: Python 2.6 is no longer supported by the Python core team, please upgrade your Python. A future version of pip will drop support for Python 2.6
DEPRECATION: --no-use-wheel is deprecated and will be removed in the future.  Please use --no-binary :all: instead.
/usr/lib/python2.6/site-packages/pip-8.1.2-py2.6.egg/pip/_vendor/requests/packages/urllib3/util/ssl_.py:318: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#snimissingwarning.
  SNIMissingWarning
/usr/lib/python2.6/site-packages/pip-8.1.2-py2.6.egg/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
Collecting setuptools
  Downloading setuptools-23.0.0.tar.gz (601kB)
    100% |████████████████████████████████| 604kB 578kB/s
Installing collected packages: setuptools
  Found existing installation: setuptools 8.2.1
    Uninstalling setuptools-8.2.1:
      Successfully uninstalled setuptools-8.2.1
  Running setup.py install for setuptools ... done
Successfully installed setuptools
Traceback (most recent call last):
  File "/usr/bin/pip", line 9, in <module>
    load_entry_point('pip==8.1.2', 'console_scripts', 'pip')()
  File "/usr/lib/python2.6/site-packages/pip-8.1.2-py2.6.egg/pip/__init__.py", line 221, in main
    return command.main(cmd_args)
  File "/usr/lib/python2.6/site-packages/pip-8.1.2-py2.6.egg/pip/basecommand.py", line 252, in main
    pip_version_check(session)
  File "/usr/lib/python2.6/site-packages/pip-8.1.2-py2.6.egg/pip/utils/outdated.py", line 102, in pip_version_check
    installed_version = get_installed_version("pip")
  File "/usr/lib/python2.6/site-packages/pip-8.1.2-py2.6.egg/pip/utils/__init__.py", line 848, in get_installed_version
    working_set = pkg_resources.WorkingSet()
  File "/usr/lib/python2.6/site-packages/pip-8.1.2-py2.6.egg/pip/_vendor/pkg_resources/__init__.py", line 619, in __init__
    self.add_entry(entry)
  File "/usr/lib/python2.6/site-packages/pip-8.1.2-py2.6.egg/pip/_vendor/pkg_resources/__init__.py", line 675, in add_entry
    for dist in find_distributions(entry, True):
  File "/usr/lib/python2.6/site-packages/pip-8.1.2-py2.6.egg/pip/_vendor/pkg_resources/__init__.py", line 1942, in find_eggs_in_zip
    if metadata.has_metadata('PKG-INFO'):
  File "/usr/lib/python2.6/site-packages/pip-8.1.2-py2.6.egg/pip/_vendor/pkg_resources/__init__.py", line 1463, in has_metadata
    return self.egg_info and self._has(self._fn(self.egg_info, name))
  File "/usr/lib/python2.6/site-packages/pip-8.1.2-py2.6.egg/pip/_vendor/pkg_resources/__init__.py", line 1824, in _has
    return zip_path in self.zipinfo or zip_path in self._index()
  File "/usr/lib/python2.6/site-packages/pip-8.1.2-py2.6.egg/pip/_vendor/pkg_resources/__init__.py", line 1704, in zipinfo
    return self._zip_manifests.load(self.loader.archive)
  File "/usr/lib/python2.6/site-packages/pip-8.1.2-py2.6.egg/pip/_vendor/pkg_resources/__init__.py", line 1644, in load
    mtime = os.stat(path).st_mtime
OSError: [Errno 2] No such file or directory: '/usr/lib/python2.6/site-packages/setuptools-8.2.1-py2.6.egg'

有什么建议吗?我试着用pip手动卸载和重新安装,但没有成功。删除setuptools后,pip抱怨文件丢失,无法继续安装。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-04-08 19:13:19

跟踪中的下面一行

File "/usr/lib/python2.6/site-packages/pip-8.1.2-py2.6.egg/pip/utils/outdated.py", line 102, in pip_version_check

显示在pip检查更新时会引发错误。作为解决办法,您可以通过将--disable-pip-version-check参数传递给pip来禁用此检查。

另外,请注意线路。

Successfully installed setuptools

在输出中。考虑到以上两点,我认为忽略这一错误是安全的。

另外,我建议不要在pip中使用sudo --请参阅Is it acceptable & safe to run pip install under sudo?,而使用--user选项或虚拟use。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/37892637

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档