简体   繁体   English

我无法更改 python 版本

[英]I am not able to change the python versions

Previously, I used to use python3.8.之前我用的是python3.8。 But recently, I have downloaded python 3.10.但是最近,我下载了python 3.10。 And also changed the path variable to the newer python version.并且还将路径变量更改为较新的 python 版本。 But still, when I run the python version command in cmd, I am seeing the older version.但是,当我在 cmd 中运行 python version 命令时,我看到的是旧版本。

The path of python 3.10, I gave in the path field of Environment variables is: C:\Users\vssnr\AppData\Local\Programs\Python\Python310\Scripts python 3.10的路径,我在环境变量的路径字段中给出的是:C:\Users\vssnr\AppData\Local\Programs\Python\Python310\Scripts

But in cmd, when I ran the following the results are looking like this :但是在 cmd 中,当我运行以下命令时,结果如下所示:

Command 1: pip --version命令 1: pip --version

pip 22.0.4 from C:\Users\vssnr\AppData\Local\Programs\Python\Python310\lib\site-packages\pip (python 3.10)来自 C:\Users\vssnr\AppData\Local\Programs\Python\Python310\lib\site-packages\pip 的 pip 22.0.4 (python 3.10)

Command 2: python -m pip install --upgrade pip命令 2:python -m pip install --upgrade pip

WARNING: Ignoring invalid distribution -ip (c:\users\vssnr\appdata\local\packages\pythonsoftwarefoundation.python.3.8_qbz5n2kfra8p0\localcache\local-packages\python38\site-packages) WARNING: Ignoring invalid distribution -ip (c:\users\vssnr\appdata\local\packages\pythonsoftwarefoundation.python.3.8_qbz5n2kfra8p0\localcache\local-packages\python38\site-packages) Requirement already satisfied: pip in c:\users\vssnr\appdata\local\packages\pythonsoftwarefoundation.python.3.8_qbz5n2kfra8p0\localcache\local-packages\python38\site-packages (22.0.4) WARNING: Ignoring invalid distribution -ip (c:\users\vssnr\appdata\local\packages\pythonsoftwarefoundation.python.3.8_qbz5n2kfra8p0\localcache\local-packages\python38\site-packages) WARNING: Ignoring invalid distribution -ip (c:\users\vssnr\appdata\local\packages\pythonsoftwarefoundation.python.3.8_qbz5n2kfra8p0\localcache\local-packages\python38\site-packages) WARNING: Ignoring invalid distribution -ip (c:\users\vssnr\appdata\local\packages\python警告:忽略无效分发 -ip (c:\users\vssnr\appdata\local\packages\pythonsoftwarefoundation.python.3.8_qbz5n2kfra8p0\localcache\local-packages\python38\site-packages) 警告:忽略无效分发 -ip (c: \users\vssnr\appdata\local\packages\pythonsoftwarefoundation.python.3.8_qbz5n2kfra8p0\localcache\local-packages\python38\site-packages) 已满足要求:c:\users\vssnr\appdata\local\packages\pythonsoftwarefoundation 中的 pip .python.3.8_qbz5n2kfra8p0\localcache\local-packages\python38\site-packages (22.0.4) 警告:忽略无效分发 -ip (c:\users\vssnr\appdata\local\packages\pythonsoftwarefoundation.python.3.8_qbz5n2kfra8p0\ localcache\local-packages\python38\site-packages) 警告:忽略无效分发 -ip (c:\users\vssnr\appdata\local\packages\pythonsoftwarefoundation.python.3.8_qbz5n2kfra8p0\localcache\local-packages\python38\site-包)警告:忽略无效分发 -ip(c:\users\vssnr\appdata\local\packages\python softwarefoundation.python.3.8_qbz5n2kfra8p0\localcache\local-packages\python38\site-packages) softwarefoundation.python.3.8_qbz5n2kfra8p0\localcache\local-packages\python38\site-packages)

Command 3: python --version命令 3:python --version

Python 3.8.10 Python 3.8.10

All these commands are given at the same location.所有这些命令都在同一位置给出。 Please inform me how I can able to shift to Python 3.10.请告诉我如何才能转移到 Python 3.10。 Also to uninstall the python3.8, I am not able to find it in uninstalling the apps, but I can find the 3.10 one.另外要卸载python3.8,我在卸载应用程序时找不到它,但我可以找到3.10的。 Please tell me why can not I find the python 3.8 in this location >> Control Panel\Programs\Programs and Features请告诉我为什么在这个位置找不到 python 3.8 >> Control Panel\Programs\Programs and Features

Maybe, there can be a PATH problem.也许,可能存在 PATH 问题。 You can add the Python to Windows Path like this https://geek-university.com/add-python-to-the-windows-path/ and you can check again Python versions with commands on cmd: python -v or python3 -v您可以像这样将 Python 添加到 Windows 路径https://geek-university.com/add-python-to-the-windows-path/并且您可以使用 cmd 上的命令再次检查 Python 版本: python -vpython3 -v

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

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