Python Forum

Full Version: Trying to get a coherent python installation
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm finding it difficult to get a consistent/coherent python installation. I had originally installed a 3.6 version of python from python.org (Windows 10 laptop). This installed to (the default location) C:\Program Files\Python36. Some time later I upgraded my Visual Studio to VS 2019. As it turns out, this also installed its own version of python (3.7) to

C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\Lib\venv\scripts\nt
C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\Extensions\Microsoft\Python\Miniconda\Miniconda3-x64

Not only did MS install three copies of python.exe, there are two more copies at

C:\Program Files (x86)\OpenOffice 4\program\python.exe
C:\Program Files (x86)\OpenOffice 4\program\python-core-2.7.6\bin\python.exe

Somewhat of a mess. It gets better.

While working with the C:\Program Files\Python36 version I had installed a few extra packages such as pymsgbox, win32com, etc. A couple of days ago I decided, to be consistent with the Visual Studio version (which I use for interactive debugging), I would upgrade the Python36 version to 3.7 as well so I downloaded that from Python.org and ran it. Naturally it upgraded the Visual Studio package and left the 3.6 version alone. Following that I uninstalled the 3.6 version (which didn't completely uninstall so I manually deleted the Python36 folder).

Now, of course, I had to manually add the VS 2019 version into my %PATH% and reinstall all the extra packages which no longer worked following the uninstall of Python36. Here's where it gets even more fun. Running any pip install, even from an admin shell, results in permission denied. So I did a "take ownership" of the Visual Studio folders and tried again. Here's the results:

D:\>pip install win32com
Collecting win32com
Could not find a version that satisfies the requirement win32com (from versions: )
No matching distribution found for win32com
You are using pip version 10.0.1, however version 19.1.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

D:\>pip --version
pip 10.0.1 from C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\Extensions\Microsoft\Python\Miniconda\Miniconda3-x64\lib\site-packages\pip (python 3.7)

D:\>python -m pip install --upgrade pip
Requirement already up-to-date: pip in c:\program files (x86)\microsoft visual studio\shared\python37_64\lib\site-packages (19.1.1)

I mean, seriously? If I wanted this much grief configuring things I would have installed linux instead of Windows.

Can anyone tell me how to clear up this (rude word) mess? Python is a very nice language. I've been a software developer for over 40 years and I think it's pretty sweet (except for the "no backslash as the final character of a raw string" thing), but nothing should be this difficult to set up.
It works better now. Fortunately I take an image of my system (C:) partition every morning so I dropped back to an image from before I tried to "fix" things. Rather than uninstall Python36 I just left it where it was and pointed the upgrade to the 36 folder. I can live with the name mismatch. Thanks for the link and the advice.