Pycharm doesn't launch pygame extension [duplicate] - python

This question already has answers here:
pycharm doesn't recognize pygame package
(2 answers)
Make sure that you use the correct version of 'pip' installed for your Python interpreter located at 'dir:\projectPath\venv\Scripts\python.exe'
(8 answers)
Closed 2 years ago.
I installed Pycharm and then for the project setting I installed the package for pygame(Specify that I work on a mackbook). After all of this I tried to run the code which is:
import pygame
pygame.init()
pygame.display.set_mode((400,500))
while True:
pass
When I run the program the Python Launcher keeps jumping in the dock but it won't work.
I've tried even before with other codes that had no other errors, but still it didn't work.

Related

How to solve Pycharm Error :- Unresolved reference: SQLAlchemy [duplicate]

This question already has answers here:
Why isn't PyCharm's autocomplete working for libraries I install?
(2 answers)
Closed 2 years ago.
I pip installed flask-sqlalchemy on my windows laptop. Pycharm gives out this error and doesn't allow me to import SQLAlchemy. I tried a bunch of solutions:
invalidate cache and restart
refreshing path
What do i do to fix this ?
You are using a virtual environment, so you should install it within your venv, not on your main python interpreter. Install it again in the terminal tab in your pycharm project.

no module of pygame error about visual studio [duplicate]

This question already has answers here:
ImportError: No module named 'pygame'
(25 answers)
Closed 2 years ago.
there, I am newbie, and I am learning pygame, but my Pycharm and Visual studio in Mac always have something wrong of pygame. I have install the pygame with pip, and it is say, 'Requirement already satisfied: pygame in /usr/local/lib/python3.9/site-packages (2.0.1)'. And today I open the Visual studio, 'ImportError: No module named pygame'. Also, the pycharm is there every time if i do a new project I must re-setting the file again to install the pygame packet? why Pygame cannot be a default module but have to set again and again. Because I am living in China and first time to run code and mac Os, if there is any tutorials for me to set the pygame, pycharm, and visual studio, and so much thank you.
Pycharm projects have a virtual environment that may not have access to the same packages as your host system. To make sure pygame is installed on the virtual environment, go to
File > Settings > Project: ____ > Python Interpreter
It will list all packages on the virtual environment. To add pygame if it's not there, go to the + sign in the bottom left corner, type in pygame, and hit Install Package

pygame isn't working on visual studio code (I'm using mac os catalina) [duplicate]

This question already has answers here:
pygame installation issue in mac os
(5 answers)
Error when installing PyGame on Mac (Catalina) [duplicate]
(2 answers)
Pygame not showing anything in the window [duplicate]
(2 answers)
Closed 2 years ago.
please can anyone help me to sort out this issue. when i try to import pygame it's not working and giving me this error
#
import pygame
ImportError: No module named pygame
i'm using python 3.8 and os catalina
Thanks.
If your import statement is # import pygame then remove the # symbol
Open the terminal and run pip install pygame and then try to import pygame
If you are using any virtual environment first activate the virtual environment from the project location and then run the above command

Pygame 1.9.6 not loading in Python 3.8.1 [duplicate]

This question already has answers here:
Problems getting pygame to show anything but a blank screen on Macos
(10 answers)
Closed 2 years ago.
Really strange issue here. I have a 64bit copy of Python 3.8.1 on my Mac (Catalina 10.15.2). I have successfully installed pygame via pip3 install pygame. Every time I run Python3 and import pygame, I get the successful message of hello from the pygame community....
However, if I run any program that requires an import of pygame, the icon for my python launcher just loops and loads for an infinite amount of time. I get no error messages. I literally get nothing. No opened windows. Just a blank line on the terminal (and IDLE terminal) window after the hello from the... message.
I have on my Mac taskbar a bouncing icon of Python, indicating that it is loading. But nothing happens? I've tested this on every instance of a pygame program with no success. Even the Aliens example embedded within the program does not work.
I had the same issue. Did this in Terminal:
python3 -m pip install pygame==2.0.0.dev6
and in PyCharm I installed pygame package once more into project interpreter with "Specify version" option selected for a specific version: 2.0.0.dev6
Then it started working.

trouble importing pygame in python 3.4 [duplicate]

This question already has answers here:
Solving "DLL load failed: %1 is not a valid Win32 application." for Pygame
(5 answers)
Closed 7 years ago.
I installed pygame using pip, but when i try to import it, it gives me this error. What could be the possible problem ?
*update, i downloaded a 32 bit version of pygame, extract it to python directory\Lib\site-packages and it's working now
This happens when the bits of python you are working and the package doesn't match. It seems you are working in a 64-bit python and you have installed 32-bit python pygame package. you can find the 64-bit pygame package here

Categories