Python Forum

Full Version: Eliminating error in Python update-alternatives
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I made an error when typing this code:

 sudo update-alternatives --install /usr/bin/python3 python /usr/bin/python2.7 1
Obviously, I do not want to that. It create issues like this:

Output:
root@LAPTOP-8R8F1BRA:/home/james# python -V Python 2.7.17 root@LAPTOP-8R8F1BRA:/home/james# python3 -V Python 2.7.17
I clearly do not want my default python to be python 2.7.17, nor do I want python3 to be python 2.7.17.

So my question is how do I correct or eliminate this error?

I have tried some things, but none of them seem to work.

Respectfully,

LZ
delete current version of python,
then reinstall following this tutorial (update version to what you want, current is 3.9.2)
[Part-1]Linux Python 3 environment
[Part-2]Python environment Windows

A better solution is to use pyenv, see:

pyenv Simple Python Version Management
I should have said that this Ubuntu is running as an app in Windows 10. The error was made in the Ubuntu app in Windows 10. I downloaded Ubuntu 18.04 from the MS store. I already have an environment of some sort in python then. But, I agree it is best to start over.

So how do I uninstall Ubuntu from Windows 10? It is being treated as a Windows 10 app. So do I just uninstall it as I would any app?

Is that the way to do it?

Respectfully,

LZ