英文:
pip cannot by found by VS Code
问题
今天我打开了VS Code并键入了以下内容:
pip
然后它显示了以下信息:
启动器中的致命错误: 无法使用以下命令创建进程:
'C:\Users\{User Name}\AppData\Local\Programs\Python\Python311\python.exe' 'C:\Users\{User Name}\AppData\Local\Programs\Python\Python311\Scripts\pip.exe'
系统找不到指定的文件。
我尝试了两次修复Python,但仍然无法解决问题。
<details>
<summary>英文:</summary>
Today I opened VS Code and typed
pip
and it said
Fatal error in launcher: Unable to create process using
'"C:\Users{User Name}\AppData\Local\Programs\Python\Python311\python.exe" "C:\Users{User Name}\AppData\Local\Programs\Python\Python311\Scripts\pip.exe" ':
The system cannot find the file specified.
**I tried to repair Python two times but it still didn't work**
</details>
# 答案1
**得分**: 1
1、打开Win10设置 -> 系统 -> 高级系统设置<br>
2、将Python路径添加到PATH中<br>
3、重新启动您的VSCode终端或重新启动VSCode或重新启动您的计算机,然后使用pip重新安装<br>
### 如果上述方法不起作用,您可以尝试使用cmd来安装软件包<br>
[![高级系统设置][1]][1]
[![将Python路径添加到PATH中][2]][2]
[![输入图像描述][3]][3]
[1]: https://i.stack.imgur.com/znR5N.jpg
[2]: https://i.stack.imgur.com/f7YDJ.png
[3]: https://i.stack.imgur.com/Ibf8f.png
<details>
<summary>英文:</summary>
1、open win10 setting->system->Advanced system settings<br>
2、add the python path to PATH<br>
3、restart your vscode terminal or restart vscode or restart you computer, then reinstall using pip<br>
### if above don't work, you should try using cmd to install packages<br>
[![Advanced system settings][1]][1]
[![add the python path to PATH][2]][2]
[![enter image description here][3]][3]
[1]: https://i.stack.imgur.com/znR5N.jpg
[2]: https://i.stack.imgur.com/f7YDJ.png
[3]: https://i.stack.imgur.com/Ibf8f.png
</details>
# 答案2
**得分**: -1
我找到了解决方法!
1. 卸载 Python 和 Python 启动器
2. 重新安装 Python
3. 运行 `pip`,它就能工作了!
[验证它已经生效][1]
<details>
<summary>英文:</summary>
I found a way to fix it!
1. Uninstall Python and Python Launcher
2. Install Python Again
3. Run `pip` and it worked!
[Proff of it worked][1]
[1]: https://i.stack.imgur.com/wf5oq.png
</details>
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论