【问题标题】:How to remove unwanted path in cmd如何在cmd中删除不需要的路径
【发布时间】:2023-03-19 08:51:01
【问题描述】:

当我尝试使用 pip 命令时,出现内部或外部命令错误,这是因为我安装了新版本的 python 3.9 然后将其删除,但我认为命令提示符仍在使用 3.9 目录中的 pip。如何从我的 PATH 中删除不需要的条目?当我使用 echo 命令时,我看到了 python 3.9,我需要删除它。

C:\Users\Rio>echo %PATH%
C:\Program Files\Python38\Scripts\;C:\Program Files\Python38\;C:\Program Files\Python39\Scripts\;C:\Program Files\Python39\;C:\Python38\Scripts\;C:\Python38\;C:\oraclexe\app\oracle\product\10.2.0\server\bin;C:\Program Files\Microsoft MPI\Bin\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\dotnet\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Heroku\bin;C:\Program Files (x86)\git\cmd;C:\Program Files\Git\cmd;C:\Program Files\nodejs\;C:\ProgramData\chocolatey\bin;C:\Program Files\CMake\bin;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files\CMake\bin;C:\Users\Rio\AppData\Local\Microsoft\WindowsApps;C:\Users\Rio\AppData\Local\Programs\Microsoft VS Code\bin;C:\Program Files\heroku\bin;C:\Users\Rio\AppData\Roaming\npm;C:\Users\Rio\AppData\Local\GitHubDesktop\bin;C:\Program Files (x86)\mingw-w64\i686-8.1.0-posix-dwarf-rt_v6-rev0\mingw32\bin;"C:\Program Files\Python38;C:\Program Files\Python38";

【问题讨论】:

    标签: python windows powershell path


    【解决方案1】:

    您可以按照此处的说明更新您的 PATH:https://www.computerhope.com/issues/ch000549.htm

    您可能还想考虑使用虚拟环境

    python3.8 -m venv venv
    .\venv\bin\activate.bat
    

    然后您的计算机将使用相应的 pip。我还敢打赌,您安装了一个名为pip3.8 的点子。尝试显式运行。

    【讨论】:

    • 是的,我正在使用虚拟方法,但我如何更改我的 python 版本,目前它自动需要 3.8.8 64 位,我需要使用 3.8.5 32 位
    • 64 位 python 可以做 32 位可以做的所有事情。我不确定你的用例是什么。您应该查看如何在 Windows 上运行多个版本的 python 或从您的机器上完全卸载 python,更新路径以删除任何带有 python 的条目,然后安装您想要的版本。
    猜你喜欢
    • 2021-09-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-07
    • 2011-11-28
    • 2017-02-22
    相关资源
    最近更新 更多