簡體   English   中英

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

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

VPS-server 是 Python 2.6 版本,我安裝了 Python 3.5.2 版本。 當我嘗試使用 help 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 的路徑?

如果您在服務器中沒有 pip,您可以使用get-pip文件:

安裝python后通常安裝pip,您可以通過pip3命令運行

例如,您可以使用:

pip3 install netaddr

手動升級 pip 一次為我解決了這個問題。 更新 pip 文檔

如果您使用從 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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM