简体   繁体   English

安装 Python 3.5.2,但安装 Python 2.6 的 pip

[英]Install Python 3.5.2, but pip for Python 2.6

VPS-server was a version Python 2.6, I installed version Python 3.5.2. VPS-server 是 Python 2.6 版本,我安装了 Python 3.5.2 版本。 When I try to install some packages with help pip , I got errors.当我尝试使用 help pip安装一些软件包时,出现错误。

During installation packages:在安装包期间:

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

Versions:版本:

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

How to change path to pip from python 3.5 ?如何从 python 3.5 更改 pip 的路径?

if you haven't pip in server you can use get-pip file:如果您在服务器中没有 pip,您可以使用get-pip文件:

after install python usually installed pip and you can run by pip3 command安装python后通常安装pip,您可以通过pip3命令运行

for example you can use:例如,您可以使用:

pip3 install netaddr

Upgrading pip manually solved this issue for me once.手动升级 pip 一次为我解决了这个问题。 Update pip Documentation 更新 pip 文档

pip is already installed if you're using Python 2 >=2.7.9 or Python 3 >=3.4 downloaded from python.org, but you'll need to upgrade pip.如果您使用从 python.org 下载的 Python 2 >=2.7.9 或 Python 3 >=3.4,则 pip 已经安装,但您需要升级 pip。

On Linux or OS X:在 Linux 或 OS X 上:

pip install -U pip

On Windows [5]:在 Windows [5] 上:

python -m pip install -U pip

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM