繁体   English   中英

无法在 python 中下载 pygame 模块

[英]unable to download pygame module in python

I am a beginner in python, I want to download a module named pygame, I was told to type pip install pygame in the command prompt, I did it, now when I went back to vscode, and run "import pygame", It says没有名为“pygame”的模块

你应该检查的事情:

  1. 在终端 (cmd) 中,键入pip list并检查 pygame 是否出现在列表中

  2. 在终端(cmd)中,如果您输入python ,会显示哪个版本的 python?

  3. 检查系统路径以查看默认 python 存储在计算机上的位置

  4. 在 vscode 上检查您是否使用相同的 python 实例

  5. 您可以尝试在所有 pip 命令pip替换为pip3并查看它是否有效,但迟早您需要更深入地了解计算机上的所有设置,这将避免您在开发过程中感到头疼

  6. 如果您迷路并且没有任何效果,我只是建议一起卸载 python,确保您已卸载计算机上的每个 python 实例并从头开始重新安装。 确保在安装时选中“添加到 PATH”

  7. 您还可以查看虚拟环境,但如果您刚开始编码以及与此相关的所有内容,它可能有点太先进了,尤其是在 windows 上(如果您碰巧在 linux 上,这可能是一个非常容易设置的解决方案在Linux上)

暂无
暂无

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

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