Pygame 1.9.6 installed, but receiving ModuleNotFoundError [duplicate] - python

This question already has answers here:
ImportError: No module named 'pygame'
(25 answers)
Pygame already installed; however, python terminal says "No module named 'pygame' " (Ubuntu 20.04.1)
(1 answer)
Closed 2 years ago.
I'm on Ubuntu 20.04. Today I installed Python 3.8.3 and Pygame 1.9.6 following the instructions on Pygame's wiki. When I tried to test that it worked by typing this in terminal:
python3 -m pygame.examples.aliens
I got this result:
/usr/local/bin/python3: Error while finding module specification for 'pygame.examples.aliens' (ModuleNotFoundError: No module named 'pygame')
However, when attempting to reinstall pygame by inputting:
sudo apt-get install python3-pygame
I get this result:
Reading package lists... Done
Building dependency tree
Reading state information... Done
python3-pygame is already the newest version (1.9.6+dfsg-2build1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
So I know it's installed and up to date, but something isn't making the connection between the two. How do I make Pygame work?

Related

How to fix the "No module named 'pygame.base'" error? [duplicate]

This question already has answers here:
Unable to install Pygame using pip
(27 answers)
Python pygame not installing
(3 answers)
Closed last month.
I've tried to use my installed pygame module in a script, but got an error "No module named 'pygame.base'". I am using a Mac. My Python version is 3.10.9.
I have searched for solutions available and tried to run pip3 uninstall pygame, pip cache purge, and pip3 install pygame to resolve this issue, but this did not help.
Thank you!

matplotlib Module not found Erorr in python even though it is in the pip list [duplicate]

This question already has answers here:
ImportError: with error 'is not a package'
(2 answers)
Closed 2 months ago.
So, i am using anaconda virtual env.
I installed some packaes and all of the worked perfectly fine expect matplotlib even though if i run pip list it appears
The Error:
ModuleNotFoundError: No module named 'matplotlib.pyplot'; 'matplotlib' is not a package
As Mr. shores suggested tha i have a file called the same name as the package name
conda install -c conda-forge matplotlib Did you tried conda package support?,Because you're in conda environment

ModuleNotFoundError: No module named 'Crypto', Python 3.9, PyCharm [duplicate]

This question already has answers here:
ImportError: No module named Crypto.Cipher
(33 answers)
Closed 2 years ago.
from Crypto.Cipher import AES
ModuleNotFoundError: No module named 'Crypto'
I am using PyCharm Community 2020.3 and Python 3.9.
This project previously compiled and ran, but I had to replace the computer and re-create my development environment, and at that point, the project failed as above.
I re-installed pycryptodome (see picture), but still getting error.
Something is causing the compiler to not take note of pycryptodome being there. Maybe something else is eclipsing it? Do I need to uninstall the library "crypto"?
I followed #madzohan link.
uninstall crypto. I had installed this because I followed PyCharm's suggestion.
uninstall pycryptodome
re-install pycryptodome
I was able to run my script no problem.

please how can i really import kivy to pycharm [duplicate]

This question already has answers here:
How to deal with Kivy installing error in Python 3.8?
(5 answers)
Closed 2 years ago.
I installed kivy using the command line as instructed in the kivy.. except for last part which says "python -m pip install kivy==1.11.1" which i tried to install according to the instruction from the site...but its giving me error messages so after some research it seems like python 3.8 does no support kivy..but i did install it manually..the main issue now is that i can't import kivy to pycharm it gives me error message "ModuleNotFoundError: No module named 'kivy'"
please what is the correct way to import kivy to pycharm?
Ok, I just solved Your problem. Use this:
python -m pip install kivy[base] kivy_examples --pre --extra-index-url https://kivy.org/downloads/simple/
Write this on PyCharm terminal and you are done!

Pygame fonts module, UnboundLocalError [duplicate]

I'm using Ubuntu 20.04.1 LTS. I have installed pygame with sudo apt-get install python-pygame. However, when I run my code using VS code, the python terminal gives the output below:
Traceback (most recent call last):
File "path", line 1, in <module>
import pygame
ModuleNotFoundError: No module named 'pygame'
I tried to reinstall Pygame using the same command. Here is the output:
Reading package lists... Done
Building dependency tree
Reading state information... Done
python-pygame is already the newest version (1.9.6+dfsg-2build1).
0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.
Basically, I already have pygame installed. So what do you think might be the reason? My Python version is 3.8.2.
Thanks in advance!
There isn't a release build of pygame 1.9.6 for Python 3.8.2. Install a development version:
python3 -m pip install pygame==2.0.0.dev10

Categories