minte9
LearnRemember / UBUNTU





Update Python

 
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt-get update

sudo apt-get install python3.6
sudo apt-get install python3.7

sudo apt install python3-pip

sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6 1
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.7 2

alias python=python3.6
echo "alias python=python3.6" >> ~/.bashrc
    #persistent alias after restart
Terminal not opening after upgrading to python3 (use VSCode terminal).
 
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.9 7
sudo update-alternatives --config python3     
    # choose 0 (3.9)

sudo rm /usr/bin/python3
sudo ln -s /usr/bin/python3.9 /usr/bin/python3

ls -la python*
python -> /usr/bin/python3.9
python2 -> python2.7
python3 -> /usr/bin/python3.9

sudo nano /usr/bin/gnome-terminal
#! /usr/bin/python2

gnome-terminal

python
Python 3.9.7 (default, Sep 10 2021, 00:03:59) 

whereis python3

pip install pyperclip

# error
# ModuleNotFoundError: No module named '_sysconfigdata__x86_64-linux-gnu'
cd /usr/lib/python3.9$
sudo ln -s /usr/lib/python3.9/_sysconfigdata__linux_x86_64-linux-gnu.py  
/usr/lib/python3.9/_sysconfigdata__x86_64-linux-gnu.py

# mouse keybord not working
sudo apt install xserver-xorg-input-all



  Last update: 675 days ago

References and applications: