pip 无法被 VS Code 找到。

huangapple go评论88阅读模式
英文:

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&#39;t work**

</details>


# 答案1
**得分**: 1

1、打开Win10设置 -&gt; 系统 -&gt; 高级系统设置&lt;br&gt;
2、将Python路径添加到PATH中&lt;br&gt;
3、重新启动您的VSCode终端或重新启动VSCode或重新启动您的计算机,然后使用pip重新安装&lt;br&gt;

### 如果上述方法不起作用,您可以尝试使用cmd来安装软件包&lt;br&gt;
[![高级系统设置][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-&gt;system-&gt;Advanced system settings&lt;br&gt;
2、add the python path to PATH&lt;br&gt;
3、restart your vscode terminal or restart vscode or restart you computer, then reinstall using pip&lt;br&gt;

### if above don&#39;t work, you should try using cmd to install packages&lt;br&gt;
[![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>



huangapple
  • 本文由 发表于 2023年6月22日 19:10:48
  • 转载请务必保留本文链接:https://go.coder-hub.com/76531292.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定