Getting error message: ModuleNotFoundError: No module named 'pygame' [duplicate] - pygame

This question already has answers here:
Problems getting pygame to show anything but a blank screen on Macos
(10 answers)
Closed 2 years ago.
Just started programming in python and pygames.
Whenever I try running a py file with pygames, the pygames window will appear, but there will be absolutely nothing in it. No errors in the log, but nothing shows, it's just a gray screen.
I tried running it on IDLE, and through the command line (I'm on a mac so I use the terminal)
And it's not just my programs that aren't showing anything, I've tried to run one of pygames examples, and it will still not display anything. For example, if I run the pygames alien example, the window will appear with a blank gray background. I'll hear the audio for the program, but no display.
Anything would help, I'm at a loss especially since no errors are showing in the log.
EDIT1:
I'm using Python 3 (and I really need to keep using Python 3)
EDIT2:
I'm using python 3.7. pygames version 1.9.4. The examples are with the pygames, they were downloaded together, so I assume it's for that version.
EDIT3:
ok, my OS is Mojave 10.14. I've tried starting the application by: opening the file, running it on IDLE, and running it through the command line, none have worked. python2 is installed, but when I run the pygame it's a python3 file

Known issue with Mojave - see their issue tracking: https://github.com/pygame/pygame/issues/555

You can also install new pygame using pip install pygame=2.0.0.dev6. This
worked in my case.

Related

Pandas-Profiling.to_widgets(): Error displaying widget: model not found

Error screenshot
I've been facing an intermittent issue with pandas profiling widget not rendering & it has been going on and off for awhile.
I've tried this in the command prompt:
jupyter nbextension enable --py widgetsnbextension
it comes up with " - Validating: ok" but still not rendering.
A quick google search led me to a few githubs/pandas-profiling/issues sections but they were a few years old.
I had this problem in Kaggle, I think it is related to memory. It happens when I repeat running my notebook a few times, without restarting the kernel.
To fix it, I just clicked Run, then Restart and Clear Outputs, and it's working again.
I have since then optimized my codes to release memory when done with them, as well as get into the habit of restarting and clearing outputs before a fresh run.
It hasn't happened on my local environment with Jupyter Notebook, probably because I have better memory locally. But if it did happen, I guess I would select Kernel, then Restart and Clear Output.

Can't add pygame to pycharm?

Could someone help me with adding pygame to pycharm, I've tried going to pycharm setting and installing pygame in the project interpreter where the + sign is
Me going to setting and project interpreter
Me going to install pygame
But when installing this error appears
Me installing but the error occurs once done
More details on the error that occur
I've tried going to the command prompt and installing pygame there
This is what I did
But this error occurs
This error always occurs
I've tried looking at my environmental variable and followed a video, to see if my path is correct, which it is. Checked that I've updated pip and that tried running the command prompt both as an administrator and not. And even tried to uninstall and install different versions of python.
At this point I need help? If anyone could help, I would be truly grateful.
I finally figured it out, IF you're using python 3.8.0, python for whatever reason not allow you to install pygame or for any other package, in fact, you'll get the errors I got above in my question. The way to fix this is that you must uninstall python 3.8.0 and install an older version (I installed Python 3.7.5), this worked for me and allowed me to download pygame. I have no idea why you can't install packages in 3.8.0 might be a bug.
I had this problem a while ago too, you could try installing pygame through pycharm's virtual terminal. Pycharm's virtual terminal is located at the bottom of the screen. To open it, the button is on the bottom left next to the Python Console and to-do list. Inside pycharm's virtual terminal you should input,
pip install pygame
After this, you should be able to import pygame with ease. Hope this helps! Make sure to mark my answer as correct if it helps you out. Have a good day.

Unable to display Octave figure in Atom on MacOS

I tried few different terminal implementations such as terminal-plus or platformio-ide-terminal on Atom (1.38.2) to run some Octave exercises. I noticed that the Octave shell runs normally until I try to plot anything.
When I type figure into the shell no window pops up and no error or any other messages appear in the terminal. Yet everything runs OK in Mac (Mojave 10.14.5) own terminal
Figured it out. The popup is there but it is buried under Atom itself. If I call figure(gcf) instead of simply figure it brings the window to the foreground and displays above the IDE. If anyone has a better answer I'll be happy to accept

tcl/tk on mac os, Python IDLE won't start and Macport not working properly

I really need someone's help here.
Early, I was playing around with homebrew, macport and active state TCL/TK after I got the new mac pro. But somehow I accidentally deleted the tcl/tclsh folder when I was trying to delete the active state version of tcl.
Now the problem is when I'm trying to install MongoDB with Macport using:
sudo port install mongodb
It give me an error says:
so I guess I delete the wrong file..is there any way I can get it back? I tried install tcl/tk using active state package but didn't work.
Help really needed...!
Thanks
The problem seems to be that you've deleted (at least part of) the system Tcl/Tk pre-installed by Apple.* MacPorts explicitly uses Apple's Tcl (or its own, if you ask it, but not ActiveState's or Homebrew's or any other). That's why it's looking for /usr/bin/tclsh rather than just whatever tclsh is on the PATH.
If you dig inside the Mountain Lion installer package, you may be able to find and run the Tcl/Tk installer manually, but Apple makes that different (and harder) with each release. The easier thing to do is just run the installer and let it repair things for you.
* It's also possible that you first replaced parts of Apple's Tcl with another version, which you shouldn't have done, and then broke that other version. But the solution is the same.

Can't get Lazarus to do.....anything?

So I thought I would install Lazarus/Free pascal -latest version from the sourceforge website.
Downloaded the win32 version and install on my XP machine couple of nights ago.
Problem is, it can't seem to find any of its own files.
From the first and every subsequent run it comes up with an error which says it can't find its system.ppu file relating to win32.
I just ignore that error and it seems to still run.
I tried to make a simple calculator application and it couldn't even seem to find the system files or files in the project directory. After battling these problems and setting every single path I could find in all the setups to every directory I could find it eventually compiled and run the program - once, not been able to make it do it again.
I also tried to make a user component library following the instructions on the web and that won't work either because, you guessed it, it can't the files. This time it gives an error saying it can't find a Ttreeview component, despite not even using that component in the library.
Being able to follow search paths is pretty fundamental stuff that they don't seem to have mastered.
Anybody managed to get a working system going, or any tips to sort these problems out?
Did you install in the default directory c:\lazarus? I thought there was an issue with installing to another directory, especially if the path contains spaces.
Nine times out of ten, its the old config of an earlier Lazarus attempt, that still lingers somewhere in the "local app" part of the profile.
If nothing else helps uninstall Lazarus, download Lazarus CodeTyphon edition, and run install as admin.