简体   繁体   中英

Why does visual studio code not recognize that i have Pygame installed?

I installed pygame through cmd using pip install pygame which can be seen in the ss. For some reason im unable to import it in my main.py file. Is there some way for me to fix this? (screenshot of terminal and vscode file)

I faced the same issue, but I had used the terminal. What I had done:

  1. Deleted pygame which was installed via pip.

  2. Installed it from the official website.

  3. Then imported pygame. It fixed the issue. I use linux

Alternatively, you can open the app installer of your device and search "pygame". Hopefully the module shows up.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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