Python Forum
problem running python file using cmd
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
problem running python file using cmd
#1
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
Reply
#2
please show how you are trying to do this step by step.
Reply
#3
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.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  rtmidi problem after running the code x times philipbergwerf 1 155 Apr-04-2021, 07:07 PM
Last Post: philipbergwerf
  python to exe running problem Roshan 2 169 Mar-30-2021, 08:59 AM
Last Post: Roshan
  Running A Parser In VSCode - And Write The Results Into A Csv-File apollo 5 512 Jan-14-2021, 08:58 PM
Last Post: snippsat
  WinError 87 while running .exe file Timych 0 688 Aug-06-2020, 02:36 PM
Last Post: Timych
  Python call/running another python file windows11 7 773 Jun-12-2020, 10:13 AM
Last Post: windows11
  Problem running script within console koepjo 3 4,249 Mar-26-2020, 07:11 AM
Last Post: koepjo
  Running problem cristipatras 4 789 Feb-20-2020, 12:03 PM
Last Post: jefsummers
  Interpreter and running a .py file give different outputs PythonNPC 5 924 Jul-21-2019, 01:07 PM
Last Post: PythonNPC
  Python problem reading file Lafayette 0 587 Jun-13-2019, 09:04 PM
Last Post: Lafayette
  Batch file not running python script in task scheduler davork 3 2,142 May-09-2019, 12:53 PM
Last Post: Gribouillis

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020