pip 无法被 VS Code 找到。

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

pip cannot by found by VS Code

问题

今天我打开了VS Code并键入了以下内容:

  1. pip

然后它显示了以下信息:

  1. 启动器中的致命错误: 无法使用以下命令创建进程:
  2. 'C:\Users\{User Name}\AppData\Local\Programs\Python\Python311\python.exe' 'C:\Users\{User Name}\AppData\Local\Programs\Python\Python311\Scripts\pip.exe'
  3. 系统找不到指定的文件。
  4. 我尝试了两次修复Python,但仍然无法解决问题。
  5. <details>
  6. <summary>英文:</summary>
  7. Today I opened VS Code and typed

pip

  1. 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.

  1. **I tried to repair Python two times but it still didn&#39;t work**
  2. </details>
  3. # 答案1
  4. **得分**: 1
  5. 1、打开Win10设置 -&gt; 系统 -&gt; 高级系统设置&lt;br&gt;
  6. 2、将Python路径添加到PATH中&lt;br&gt;
  7. 3、重新启动您的VSCode终端或重新启动VSCode或重新启动您的计算机,然后使用pip重新安装&lt;br&gt;
  8. ### 如果上述方法不起作用,您可以尝试使用cmd来安装软件包&lt;br&gt;
  9. [![高级系统设置][1]][1]
  10. [![将Python路径添加到PATH中][2]][2]
  11. [![输入图像描述][3]][3]
  12. [1]: https://i.stack.imgur.com/znR5N.jpg
  13. [2]: https://i.stack.imgur.com/f7YDJ.png
  14. [3]: https://i.stack.imgur.com/Ibf8f.png
  15. <details>
  16. <summary>英文:</summary>
  17. 1open win10 setting-&gt;system-&gt;Advanced system settings&lt;br&gt;
  18. 2add the python path to PATH&lt;br&gt;
  19. 3restart your vscode terminal or restart vscode or restart you computer, then reinstall using pip&lt;br&gt;
  20. ### if above don&#39;t work, you should try using cmd to install packages&lt;br&gt;
  21. [![Advanced system settings][1]][1]
  22. [![add the python path to PATH][2]][2]
  23. [![enter image description here][3]][3]
  24. [1]: https://i.stack.imgur.com/znR5N.jpg
  25. [2]: https://i.stack.imgur.com/f7YDJ.png
  26. [3]: https://i.stack.imgur.com/Ibf8f.png
  27. </details>
  28. # 答案2
  29. **得分**: -1
  30. 我找到了解决方法!
  31. 1. 卸载 Python Python 启动器
  32. 2. 重新安装 Python
  33. 3. 运行 `pip`,它就能工作了!
  34. [验证它已经生效][1]
  35. <details>
  36. <summary>英文:</summary>
  37. I found a way to fix it!
  38. 1. Uninstall Python and Python Launcher
  39. 2. Install Python Again
  40. 3. Run `pip` and it worked!
  41. [Proff of it worked][1]
  42. [1]: https://i.stack.imgur.com/wf5oq.png
  43. </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:

确定