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
  problem in running a code akbarza 7 547 Feb-14-2024, 02:57 PM
Last Post: snippsat
  error "cannot identify image file" part way through running hatflyer 0 617 Nov-02-2023, 11:45 PM
Last Post: hatflyer
  Web project and running a .py file emont 0 620 Dec-11-2022, 11:15 PM
Last Post: emont
  Problem with importing Python file in Visual Studio Code DXav 7 4,937 Jun-15-2022, 12:54 PM
Last Post: snippsat
  batch file for running python scipt in Windows shell MaartenRo 2 1,825 Jan-21-2022, 02:36 PM
Last Post: MaartenRo
  Problem in saving .xlsm (excel) file using pandas dataframe in python shantanu97 2 4,164 Aug-29-2021, 12:39 PM
Last Post: snippsat
  rtmidi problem after running the code x times philipbergwerf 1 2,398 Apr-04-2021, 07:07 PM
Last Post: philipbergwerf
  python to exe running problem Roshan 2 5,520 Mar-30-2021, 08:59 AM
Last Post: Roshan
  Running A Parser In VSCode - And Write The Results Into A Csv-File apollo 5 4,542 Jan-14-2021, 08:58 PM
Last Post: snippsat
  WinError 87 while running .exe file Timych 0 2,329 Aug-06-2020, 02:36 PM
Last Post: Timych

Forum Jump:

User Panel Messages

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