如何仅在 virtualenv 中使用 Pip(或 easy_install)安装 Python 3.8.7

问题描述 投票:0回答:1

我创建了一个 virtualenv,并希望使用 pip 或 easy_install 工具安装 python v.3.8.7,而不影响系统上安装的 Python 版本(Python 2.7)。

我尝试使用:

pip install python3 --upgrade #in the virtual environment

但是错误表明我需要升级 Python 2.8,这是我的机器上使用的主要 Python(不是 virtualenv)

 DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
    ERROR: Could not find a version that satisfies the requirement python3 (from versions: none)
    ERROR: No matching distribution found for python3



python -m pip3 install --upgrade pip

我尝试仅在 virtualenv 上升级 pip:但同样的错误:

DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
Requirement already up-to-date: pip in ./lib/python2.7/site-packages (20.3.4)

如何使用 pip 或 easy_install 在虚拟环境中安装 Python 3.8.7?

python python-3.x pip
1个回答
0
投票

我认为您的系统中没有安装python3.8.7?我的意思是 python 文件安装在他们的网站中,而不是 pip 安装在你的环境中。 您可以访问 https://www.python.org/downloads/release/python-387/

© www.soinside.com 2019 - 2024. All rights reserved.