【问题标题】:Install Python 3.5.2, but pip for Python 2.6安装 Python 3.5.2,但为 Python 2.6 安装 pip
【发布时间】:2016-09-13 20:26:08
【问题描述】:

VPS-server 是 Python 2.6 版本,我安装了 Python 3.5.2 版本。 当我尝试在pip 的帮助下安装一些软件包时,出现错误。

安装包期间:

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

版本:

# Python -V
# Python 3.5.2

# pip -V
# pip 8.1.2 from /usr/lib/python2.6/site-packages/pip-8.1.2-py2.6.egg (python 2.6)

# cat /etc/*-release
# CentOS release 6.8 (Final)

如何从 python 3.5 更改 pip 的路径?

【问题讨论】:

  • 您尝试过:sudo pip3 install 吗?

标签: python centos pip


【解决方案1】:

如果你还没有 pip 在服务器中,你可以使用get-pip 文件:

安装python后通常会安装pip,可以通过pip3命令运行

例如,您可以使用:

pip3 install netaddr

【讨论】:

  • pip 已安装:# pip -V # pip 8.1.2 from /usr/lib/python2.6/site-packages/pip-8.1.2-py2.6.egg (python 2.6)
  • 您的 pip 来自 python 2.6,您可以创建虚拟环境并安装 pip3 。或者在服务器中安装 pip3
【解决方案2】:

手动升级 pip 曾经为我解决了这个问题。 Update pip Documentation

如果您使用的是从 python.org 下载的 Python 2 >=2.7.9 或 Python 3 >=3.4,则已安装 pip,但您需要升级 pip。

在 Linux 或 OS X 上:

pip install -U pip

在 Windows [5] 上:

python -m pip install -U pip

【讨论】:

  • Requirement already up-to-date: pip in /usr/lib/**python2.6**/site-packages/pip-8.1.2-py2.6.egg
猜你喜欢
  • 2014-08-09
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-01-05
  • 2020-01-06
  • 2015-08-12
  • 2018-05-14
相关资源
最近更新 更多