I have a fresh installation of Raspbian Lite. This one comes with Python 2.7 and 3.7 and no pip installed. I wanted to install Python 3.9.1 and followed the instructions from here.
To briefly state the steps given there: Install dependencies, extract Python from the downloaded archive, ./configure --enable-optimizations
, make
and make altinstall
.
After completing the installation I realised that Python was installed in /usr/local/bin/python3.9
and pip is installed in usr/local/lib/python3.9/site-packages/pip
. While the other Python installations are in /usr/bin/
.
- Can I (Should I?) somehow have it installed in
/usr/bin/
? - In the future if I want to install Python and pip in
/usr/bin/
what should I change in the above set of commands? I remember seeing in an tutorial article(that I am unable to find now) that they pass additional arguments to./configure
that seemed like specifying the directory to install python in. - Now that it is installed there, I can directly set alias in
.bashrc
forpython3.9
andpip3.9
aspython
andpip
, right?
.bashrc
- progams installed in/usr/local/bin
will run in preference to/usr/bin
. You could run specific versions with python3.9 or python3.7 – Milliways Jan 8 at 22:57