Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Can't get rid of old version of python

78 views
Skip to first unread message

Ciarán Ó Duibhín

unread,
Aug 13, 2021, 2:38:28 PM8/13/21
to
Hi,

On Windows 10, I uninstalled all previous versions of Python and
installed v3.9.6.

When I use the start menu option Python 3.9 (64-bit), I get the prompt
"Python 3.9.6" as expected. The same happens when I type "py" at the
DOS prompt.

But when I type "python" at the DOS prompt, I get "Python 3.8.10". I
don't understand this, as I uninstalled old versions, and I do not see a
DOS environment variable called "python" anywhere.

The real problem comes when I install a package, e.g. germalemma.
Python 3.8.10 can use it, but Python 3.9.6 can't find it.

I notice that "site-packages" containing germalemma and its dependencies
is located in
...Packages\PythonSoftwareFoundationPython.3.8.qbz5n2kfra8p0\LocalCache\local-packages\Python3.8

Also there is a load of python 3.8 stuff at C:\Program
Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.2800.0_x64__qbz5n2kfra8p0
which directory is virtually inaccessible from Windows but can be listed
in DOS.

How can I get rid of Python 3.8.10 , and install my packages to 3.9.6?

Ciarán Ó Duibhín

Dennis Lee Bieber

unread,
Aug 13, 2021, 4:37:06 PM8/13/21
to
On Fri, 13 Aug 2021 18:32:51 +0000, Ciarán Ó Duibhín via Python-list
<pytho...@python.org> declaimed the following:

>
>Also there is a load of python 3.8 stuff at C:\Program
>Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.2800.0_x64__qbz5n2kfra8p0
>which directory is virtually inaccessible from Windows but can be listed
>in DOS.
>
>How can I get rid of Python 3.8.10 , and install my packages to 3.9.6?
>
You probably can't... The keyword being "WindowApps".

That version likely was installed using the Win10 "app store" (aka:
"microsoft store"). You can open that, click the ... and pick "my library",
pick "installed" and likely find a Python entry. But the appstore does not
allow one to delete downloaded apps! It MIGHT be removable if you locate a
"Python" icon on the start-menu and right click "uninstall" -- but make
sure it is not YOUR Python...

The simplest method would be to ensure YOUR Python is at the top of the
PATH environment variable so it is found first when searching for
applications.


--
Wulfraed Dennis Lee Bieber AF6VN
wlf...@ix.netcom.com http://wlfraed.microdiversity.freeddns.org/

Terry Reedy

unread,
Aug 13, 2021, 5:58:26 PM8/13/21
to
On 8/13/2021 2:32 PM, Ciarán Ó Duibhín via Python-list wrote:
> Hi,
>
> On Windows 10, I uninstalled all previous versions of Python and
> installed v3.9.6.
>
> When I use the start menu option Python 3.9 (64-bit), I get the prompt
> "Python 3.9.6" as expected.  The same happens when I type "py" at the
> DOS prompt.
>
> But when I type "python" at the DOS prompt, I get "Python 3.8.10".  I
> don't understand this, as I uninstalled old versions, and I do not see a
> DOS environment variable called "python" anywhere.
>
> The real problem comes when I install a package, e.g. germalemma. Python
> 3.8.10 can use it, but Python 3.9.6 can't find it.

If 'py' starts 3.9, then

py -m pip install xyz

will install xyz for 3.9. (In not, py -3.9 -m pip ... will)

The command 'python' takes one to the MS store unless one has already
gotten the store python.

--
Terry Jan Reedy


Eryk Sun

unread,
Aug 13, 2021, 6:49:04 PM8/13/21
to
On 8/13/21, Ciarán Ó Duibhín via Python-list <pytho...@python.org> wrote:
>
> But when I type "python" at the DOS prompt, I get "Python 3.8.10". I
> don't understand this, as I uninstalled old versions, and I do not see a
> DOS environment variable called "python" anywhere.

The app distribution is probably installed. You can uninstall it in
the "Apps" view of the settings apps. The app should be named "Python
3.8" from "Python Software Foundation". Alternatively, if you want to
keep the app distribution, you can simply remove interfering aliases.
Towards the top, there's a link to set "App execution aliases". You
can disable all of the Python-related aliases, or keep specific
aliases such as "python3.8.exe", "pythonw3.8.exe", "pip3.8.exe", and
"idle3.8.exe".

---

FYI, back in the 1990s, when users opened a "DOS Box" in Windows 9x,
it was literally the 16-bit DOS kernel and "COMMAND.COM" shell
executing in a virtual DOS machine (VDM) using the CPU's virtual-86
mode. Various software interrupts were hooked to integrate with the
virtual machine manager (the 32-bit OS at the core of Windows 9x) and
connect the UI to a desktop window. The term "DOS Box" made perfect
sense back then.

In modern Windows systems, which are based on NT instead of DOS, the
classic command-line shell is called the "Command Prompt" or "CMD".
The CMD shell (cmd.exe) is a Windows console application. It supports
the batch language and a superset of the commands from the
"COMMAND.COM" DOS shell. Compatibility with the DOS shell was crucial
when CMD was designed for OS/2 in 1986 and subsequently ported to
Windows in 1993. But it's only high-level and superficial
compatibility. CMD directly consumes the Windows API. It is not a DOS
application executing in a VDM. 64-bit Windows systems don't even
include VDM support.

Ciarán Ó Duibhín

unread,
Aug 13, 2021, 7:13:44 PM8/13/21
to
Many thanks for both replies. Everything seems fine now.

Reinstalling the packages using "py" made them available in v3.9.6. So
I could delete them from
C:\Users\...\AppData\Local\Packages\PythonSoftwareFoundationPython.3.8.qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages
In fact I deleted the whole of
C:\Users\...\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8.qbz5n2kfra8p0

Asking where "python" finds its (supposed uninstalled) v3.8.10
executable was sending me to
'C:\Users\…\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\python.exe'
but deleting as above meant there is no longer a "python" command to
worry about.
I may try to remove that whole subdirectory of WindowsApps and the
somewhat similar one in C:\Program Files\WindowsApps

I think any other applications that use python probably have their own
copy of python.exe — LibreOffice and GIMP 2 certainly have, with version
numbers which are different again.

Ciarán Ó Duibhín

unread,
Aug 13, 2021, 7:36:54 PM8/13/21
to
Thanks for the two further clarifications, which I've just read.
Eryk's advice for uninstalling the app distribution got rid of those
unwanted WindowsApps subdirectories painlessly.


0 new messages