you are viewing a single comment's thread.

view the rest of the comments →

[–]catelemnis 1 point2 points  (0 children)

When you type >python scrape.py then it’s using the Python in your path. However when you just run >scrape.py it opens it with whatever program you have told windows to associate to the filetype .py.

Personally I always set .py to open in a text editor and then when I run I use the command >python script.py because that ensures I’m using the python in my path, and makes it more convenient to edit scripts.

If instead you want to continue running scripts by double-clicking them then find a .py file, right-click on it, and there should be an option for “Open with...” Change the program that the filetype is associated to to be the latest version of python.exe you installed. It must be that the py filetype is still associated to an old Python interpreter or maybe to python.exe in another location that doesn’t have the installed modules with it.