1

I like testing my python files from command prompt instead of inside of PyCharm, which is what I use. I use Python 3.6, and after downloading Python 2.7, there was clearly some kind of conflict, It would no longer execute my python files directly in command prompt. I reverted everything back to normal, but it now uses "pythonw" to externally execute my file, instead of executing it right inside command prompt, how can I restore this?

Example:

C:Users\User\PycharmProjects(file-name)> main.py

(Executes through pythonw)

I'd like it to execute directly in command prompt as it used to by default, instead of it using something external. Thanks.

1 Answers1

0

If you are using python on Windows you may just need to edit your path variable that executes Python from pythonw.exe to python3.exe (or whatever the version is that you expect it to execute). See below link:

http://pythoncentral.io/add-python-to-path-python-is-not-recognized-as-an-internal-or-external-command/

jasonleehodges
  • 191
  • 2
  • 13
  • The directory to my python.exe (Using Python 3.6, by the way) is already in my path, and pythonw isn't. When I had the conflicts between 2.7 and 3.6,, I would enter main.py in, and it would ask "What to use in order to open it",Just like how it would ask the User what to use in order to open odd file types. Not knowing what the result would be, I chose pythonw and cannot reverse it. – ShawnCole22 Jan 23 '17 at 02:11
  • Can you navigate to the file in windows explorer, hold control, and then select "Open with" and then see if you can navigate to the appropriate version of python and then click the "always use this option"? – jasonleehodges Jan 23 '17 at 02:13
  • Yes! Worked out perfectly. Thanks a ton. – ShawnCole22 Jan 23 '17 at 02:19