Python Forum

Full Version: problem running python file using cmd
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi everyone,

I have a game.py that i would like to run in cmd (works perfectly fine in pycharm). however when i run it it says ModuleNotFoundError. No module named 'pygame'

the lib i want to import is pygame.

directory
C:\Users\Panzers\Desktop\Python Projects\Python Game\

thanks for your help
please show how you are trying to do this step by step.
erm.. which part u dont understand?

when i run:
C:\Users\Panzers\Desktop\Python Projects\Python Game\game.py

the error ModuleNotfoundError - no module named 'pygame' shows up. But it works perfectly in pycharm.

my guess is the cmd is unable to process the library thus unable to load the python file. But i am not sure how to solve it.