Python --version 不更新 [英] Python --version does not update
问题描述
我升级并安装了最新的 Python 版本 3.8.1.
I upgraded and installed latest Python version 3.8.1.
问题是,当我输入
python --version
在终端上,当我输入
python3 --version
我得到了 Python 3.8.1.但是如果我尝试
I get Python 3.8.1. But if I try to
pip install -U selenium
我收到一条消息:
弃用:Python 2.7 已于 1 月 1 日生命尽头,2020. 请升级您的 Python,因为 Python 2.7 不再维护.pip 的未来版本将不再支持 Python 2.7.有关 pip 中 Python 2 支持的更多详细信息,请访问https://pip.pypa.io/en/latest/development/release-process/#python-2-support"
"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. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support"
我不明白为什么它在 Python 2.7 上运行
I dont understand why is it running on Python 2.7
推荐答案
永远不要调用 pip
或 pip3
脚本 除非您真正了解其含义.
Never call the pip
or pip3
scripts directly unless you really understand what the implications are.
相反,总是更喜欢调用您所针对的确切 Python 解释器,并告诉它运行 pip
可执行模块:
Instead always prefer calling the exact Python interpreter you are targeting and tell it to run the pip
executable module:
path/to/my/pythonX.Y -m pip
path/to/my/python -m pip
path/to/venv/bin/python -m pip
pythonX.Y -m pip
python3 -m pip
python -m pip
我建议阅读 Brett Cannon 的文章为什么你应该使用 python -m pip
".
这篇关于Python --version 不更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!