Python Forum
Python 3.x Windows 7 registry file associations broken - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Python 3.x Windows 7 registry file associations broken (/thread-4909.html)



Python 3.x Windows 7 registry file associations broken - pixhellmann - Sep-12-2017

Hi,

I deleted some windows registry keys dealing with the python file associations.
I thought then reinstalling the python setup will fix it back up. But it doesn't!

now here is my situation:

I had two Python version installed: Anacondas Python 2.x and lately python 3.5.
I wanted to drag and drop some files from the explorer onto my python script and use the files as args to be processed.
I had the situation that if I type 'python' in the command line, it started the latest Python 3.5 interpreter. But if I drag and dropped files on a .py file, it started with the other Python 2.x version.

my first thought was to change the file association:
I used the rightclick open file with... and chose the python3.5.exe. but now the ability to drag and drop files on the py files is gone.
I've also found the "solution" that I have to adjust the registry and add %* to the open command in the registry. eventually I messed things up and thought to delete the reg entries.
it's pretty confusing and I can't find anywhere which entries are required.

how can I make a clean python install to restore a default windows installation including all required registry keys and defuslt file associations?

thanks anyone for your input!


RE: Python 3.x Windows 7 registry file associations broken - sparkz_alot - Sep-12-2017

(Sep-12-2017, 04:52 PM)pixhellmann Wrote: I had two Python version installed: Anacondas Python 2.x and lately python 3.5.

Do you still have Anaconda installed? File associations can be made via Control Panel-->Default Programs. By default, Python's default interpreter is the first one installed, and can be called by the vanilla "python". Subsequent version installations have to be called with the version number, for example "python3.5". If Anaconda is not longer installed, you will probably have to change your Environmental Variables to reflect where the Python3.5 and Python3.5/Scripts directories are. See this tutorial: https://python-forum.io/Thread-Basic-Set-Windows-Python-Path-to-run-python-in-any-directory

We also have a tutorial for a new install of Python on Windows. If you do this, I would recommend you install version 3.6.2 (the latest version):
https://python-forum.io/Thread-Basic-Part-1-Python-3-6-and-pip-installation-under-Windows
Quote:I wanted to drag and drop some files from the explorer onto my python script ...

You can't do that. "Drag and Drop" moves or replaces a file, it does not copy within an existing file. If you want to use a Python module within another, you need to "import" it.

EDIT: Unless you know exactly what you are doing, stay out of the Registry, there is no reason to be in there.


RE: Python 3.x Windows 7 registry file associations broken - Larz60+ - Sep-12-2017

Quote:EDIT: Unless you know exactly what you are doing, stay out of the Registry, there is no reason to be in there.
As Sparks_alot says, stay away from the registry. Sooner or later it will bite you.

You can safely delete applications with the following steps:
  • start->controlPanel
  • select programs and features
  • right click on program you wish to uninstall
  • click uninstall