Python Forum
Python 3.x Windows 7 registry file associations broken
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python 3.x Windows 7 registry file associations broken
#1
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!
Reply
#2
(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...-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-Par...er-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.
If it ain't broke, I just haven't gotten to it yet.
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition
Reply
#3
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
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Question How to add Python folder in Windows Registry ? Touktouk 1 248 Feb-20-2024, 01:04 PM
Last Post: DeaD_EyE
  Read complete windows registry? fredep57 3 936 Mar-15-2023, 08:14 PM
Last Post: buran
  Why is copying and pasting a block now broken? WagmoreBarkless 2 1,389 May-05-2022, 05:01 AM
Last Post: WagmoreBarkless
  Why is copying and pasting a block now broken? WagmoreBarkless 1 1,228 May-04-2022, 11:40 PM
Last Post: Larz60+
  batch file for running python scipt in Windows shell MaartenRo 2 1,884 Jan-21-2022, 02:36 PM
Last Post: MaartenRo
  BrokenPipeError: [Errno 32] Broken pipe throwaway34 6 9,240 May-06-2021, 05:39 AM
Last Post: throwaway34
  How to add new registry key shlomi27 3 10,297 Feb-04-2021, 05:45 PM
Last Post: reidnax
  Using a .bat file to execute simple anaconda commands in Windows 10 gacg1 0 4,675 Nov-30-2020, 03:24 PM
Last Post: gacg1
  Python broken if moved to a different folder ecastrotns 3 2,437 Oct-26-2020, 10:53 PM
Last Post: ecastrotns
  STT: recognition connection failed: [Errno 32] Broken pipe GrahamBerends 0 5,053 Jul-18-2020, 11:00 PM
Last Post: GrahamBerends

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020