Python 3.13.1 installer creates thousands of "useless" entries in registry

I use to install apps (in Windows) using tools like Revo Uninstaller, that show the silent fingerprint of an installation.

In this Python 3.13 case, it has detected a big quantity of registry entries, specially in the branch:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\[xxxxxx]\Components

Around 4241 new entries have been added.

You may think: “I suppose that, if they are there, is because the’re all important, why do you dare to doubt?

Some of them are simple paths to “useless” files, for example “pystats.h” file, that has a very low probability of being used by a python programmer.

So, this registry branch seems to keep track (very inefficiently!!) of all the installed python files. It’s like a mirror file system. You may think: “It’s ok, because it will be used to track files when uninstalling. And again, why do you dare to doubt?”.

With this philosophy in mind, the registry turns into an absurd file system into the file system.

Every installed application with thousands of files will replicate its structure (!!) inside the registry, not even trying to compress the humongous list of thousands files (it would be easy!). All of them will be thrown painlessly to the registry basket, no problem. Even knowing that this files list is not useful for Windows, just for the app uninstaller, then, why storing this junk in the registry?

See what Jeff Atwood (the creator of StackOverflow) said in 2007 (and still appliable, sadly…) : “[The registry] has slowly become a trash heap of miscellaneous junk settings for every rinky-dink application on the planet”

So my question is: Is there another cleaner way to install Python?

First tell us what installer you used (from where) and *exactly# how you used it.

2 Likes

I did a search on my machine, and to me it just looks like this is windows working as expected. Every microsoft installer I have used has a bunch of entires in this registry. Where I have not used an installer, there are none.

On my end, after searching trough and counting, Python is less then 1% of my entires.

So my question is: Is there another cleaner way to install Python?

Im not sure this is a problem you should worry about, as this does not look like a python related issue, but a Microsoft one.
I build my own versions of Python on windows, and those do not have a corresponding entry in the registry, I would not call that a cleaner way to install Python though.

eivl

2 Likes

Is there any reason why you consider this to be messy? On Windows, the registry is not something users should need to concern themselves with. It is a mess, and will always be.

Did you look at this folder in the registry editor? If you had done that, you would have noticed that many applications installed on your system have also placed one entry per the file they shipped. This folder is maintained and created by Windows Installer, and Python has no way to avoid creating any entries there (unless it were to stop using Windows Installer, but that would require Python to use some third-party product or build its own from scratch).

The installer used is the official: https://www.python.org/ftp/python/3.13.1/python-3.13.1-amd64.exe

As a Windows user, and also C++ and C# developer, I am used to see installers dropping junk entries into the the registry. But I have difficulties to consider 4241 entries a simple “bunch”. And even more if stored inefficiently, and with the suspicion of being “useless”.

May be you are right, and I shouldn’t worry about this problem. But I am the kind of programmer that worries a bit about efficiency, and about wasting.

You are also right, it’s not a python issue, not even a Windows issue I should say, but a installer one. Do python team know about this installer behavior? Perhaps they know, but don’t care?

I thought I should shed light a on it.

P.S.: After some tweaking, I “solved” the problem (or I think so). Steps:

  1. Install Python with the installer (thousands of questionable entries thrown to registry).
  2. Locate the folder (in my case %LOCALAPPDATA%\Programs\Python\Python313), and copy it apart, everywhere, another folder, drive, etc.
  3. Uninstall Python, from “Programs and Features”, or wherever you do to remove apps. Happily, the thousands entries disappear. Not all the installers do :wink:
  4. Put your python copy back to its place, %LOCALAPPDATA%\Programs\Python\Python313
  5. Configure your favourite tool (Visual Studio Code in my case) to use that path, and… voila!

Now, developing and debugging goes like a charm.

I interpret it as the final proof: Those registry entries where really junk, a sad confirmation of Jeff Atwood words, because Python works fine without them.

And uninstalling is as easy as deleting the folder, not so much information needed.

Only for love to efficiency.

Imagine you have a wide hallway, and one day I come to your house, and use your hallway to store lots of empty boxes along. You still have space enough to walk, or even run, or whatever. But you will think… why in the hallway? Why not in the storage room? And why don’t we fold (compress) those empty boxes so they occupy less? And what if you discover that those boxes are useful for… nothing??

I agree, as Jeff Atwood did, that Registry is a mess.

And yes, that registry branch is a big dump for many other installations. According to this answer (When - and why - should you store data in the Windows Registry? - Stack Overflow), it is a Windows 95 way (ahem… fossil :roll_eyes:) of doing things.

Microsoft gave us the power to store whatever junk in the Windows hallway. But the final decission to agree is ours. In this case, the developers of the installer agreed. And I wonder if python team knows it, and if they agree too.

Sure, many things may work if you uninstall. But others will not, e.g. file associations, or the py launcher, which expects some registry entries to exist (not the installer ones though). Windows Installer can also help fix the install if some files get damaged or removed. This repair is one of the uses of those registry keys.

Again: those entries do not “belong” to Python and are not Python’s fault. They are created by Windows Installer, a standard Windows component since 1999. And while it’s not the best design out there, there is zero downside or issue with having “messy” registry keys.

1 Like

@steve.dower Is ‘Windows Installer’ part of what you want to replace? The topic OP ‘wonders’ whether we (you) know that it makes a separate registry entry for each of the ~4200 files. I presume ‘yes’.

1 Like

Yes, my plan is to drop use of Windows Installer entirely (which is what creates the registry entries, so that it can track which files have been installed for the purposes of update/repair/etc.).

See the proposal in PEP 773 – A Python Installation Manager for Windows | peps.python.org and the associated discussion in PEP 773: A Python Installation Manager for Windows.

2 Likes

Yes, losing file associations is a drawback.

I have tracked applications, like “AOMEI PE Builder”, that installs 2561 files, and however, only inserts 29 registry entries. And it has the usual repair and uninstall options. This suggests there is no need of mirroring all application file paths in the registry.

May be the deploy of the python .EXE installer has some default option, that creates the full mirror of all the file paths? When there is no need to, of course.