简体   繁体   中英

no module pygame in Pycharm

I try to work for the first time with Kivy, I install it but when I run the program I have this error message: 在此处输入图片说明

And I try to install pygame, but I still have the same error: 在此处输入图片说明

Any help please?

To ensure proper setup, you can download pygame from PyCharm directly.

单击“+”按钮添加 PyGame 包

进入 PyGame 并按“安装包”

You should now be able to import pygame and use them in your scripts.

For PyCharm, go to:

  1. File
  2. Settings
  3. Project: Project_Name
  4. Click the '+' icon (located on the bottom side). Then will Appear new window.
  5. Search pygame on this window
  6. Then click 'Install Package'
  7. close the window and run your code.

Most of the time it's due to not having the interpreter installed.

On terminal:

  • pip install pylint (to install globally)
  • Restart pycharm and click on install package "pygame" over the error it shows. This also applies for most of the other packages.

If you are using VsCode or any other, just pip install pygame (or any other needed) and it should be working.

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