0

I just re installed Python after not having used it for a while, and can't seem to do it. Every time I click on a .py file, I get the error message "...py is not a valid Win32 application". I'm running 64bit windows, and download the 32 bit version. I researched the problem and tried both solutions mentioned here

[Solving "DLL load failed: %1 is not a valid Win32 application." for Pygame

Neither of them worked. I changed my variable paths because I remember messing with them the first time I downloaded Python years ago, but that didn't seem to make a difference either. Anyone have any other ideas?

Community
  • 1
  • 1
Fantikz
  • 55
  • 5
  • Did you try to run ''C:/Python/Python27/python.exe C:/yourfile.py'' – user1767754 Sep 15 '14 at 20:54
  • What happens if you try `python --version` from cmd? – Nick Humrich Sep 15 '14 at 20:54
  • Did you uninstall the older version of Python and installed a new one or installed the new version on the old? – Vizjerei Sep 15 '14 at 20:58
  • Version is 2.7.8. After running my file in cmd, I get "IOError: [Errno 2] No such file or directory: 'addition.py'" I know these files work, because I downloaded this tutorial on my desktop and had no problems with it. – Fantikz Sep 15 '14 at 21:03
  • I uninstalled the old version, then installed the new – Fantikz Sep 15 '14 at 21:03
  • Tryed setting the `PYTHONPATH` and the python folder to `PATH` environmental variable? – Vizjerei Sep 15 '14 at 21:07
  • How would I go about doing that? – Fantikz Sep 15 '14 at 21:14
  • [This might help with PYTHONPATH and environmental PATH](http://stackoverflow.com/questions/3701646/how-to-add-to-the-pythonpath-in-windows-7) – Vizjerei Sep 15 '14 at 21:18
  • Still no luck, still getting the same error message – Fantikz Sep 15 '14 at 21:28
  • That error usually means you've installed some 64-bit packages (e.g., with Christoph Gohlke's installer packages) on 32-bit Python, or vice-versa, or you're trying to share a site-packages between two different Pythons. (It can also mean that you're mixing up Cygwin Python with native or MinGW Python, but most people who ask this question have never heard of Cygwin, so that's unlikely to be the issue.) – abarnert Sep 15 '14 at 21:30
  • Is there any easy way to clean all python packages off my computer? – Fantikz Sep 15 '14 at 21:33
  • 1
    If you haven't logged out, give that a try. Then open a command line and run `assoc .py`, you should see `.py=Python.File`. Then run `ftype Python.File`, you should see the python.exe command line - check to make sure that its the one you installed. (3) `echo %PATH%` and `echo %PYTHONPATH` to make sure you don't have paths to your old python in there. – tdelaney Sep 15 '14 at 23:01
  • did `dir` show 'addition.py' – Smart Manoj Apr 15 '19 at 14:00

0 Answers0