0

I am trying to run a simple Hello World code in pycharm using Python. I have moved the file to another folder. So, I have changed the interpreter location I am getting the following error. This problem has nothing to do with interpreter as you can see in the second image, the interpreter is the correct one and I am able to run it from command prompt.

C:\Users\bitan\AppData\Local\Programs\Python\Python38-32\python.exe: can't open file 'C:/Python/Free Code Camp/Learning': [Errno 2] No such file or directory

Process finished with exit code 2"

Error Image Interpreter Location Change

I am new to Pycharm/Python. Any help is appreciated.

Economics User
  • 11
  • 1
  • 1
  • 5
  • 1
    Your script is named `Learning.py`, not just `Learning` - but I don't know where Pycharm is getting that command line from, so I don't know exactly what you need to change. – jasonharper Aug 23 '20 at 05:00
  • @jasonharper Thanks a lot Jason, that solved my problem. If anyone else face the same issue, I am adding how to change it. On the top right, click on edit configuration -> Change Script Path. – Economics User Aug 23 '20 at 07:06
  • Please don't post screen shots, and especially not low-contrast screen shots, which are hard for some users to read. – tripleee Aug 23 '20 at 07:07
  • ANSWER: PyCharm > select "Run" menu > select "Edit Configurations" menu option > choose configuration to edit > the value of the "Script Path" field needs to be a valid path to a *.py file on your OS > click OK – JustBeingHelpful Sep 25 '20 at 17:08

1 Answers1

-3

go to cmd prompt and type cd <path/of/your/python/file>

then type python3 file_name.py

hope it works. if you get an error comment it.