Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between /usr/bin/python3 and /bin/python3

So, I was using visual studio code and wanted to see what option do I have for interpreter in vscode in my Ubuntu 21.04 machine and what I found are these options. First is the virtual environment python interpreter and I guess 2nd is the system python interpreter so what is the 3rd interpreter option that I am getting and this is my question.

like image 693
HARSHAL RATHORE Avatar asked Jul 24 '26 02:07

HARSHAL RATHORE


2 Answers

From Linux file-hierarchy manual:

/bin/, /sbin/, /usr/sbin/

These compatibility symlinks point to /usr/bin/, ensuring that scripts and binaries referencing these legacy paths correctly find their binaries.

In my computer (Ubuntu 20.04) /bin/python3 is a link to /usr/bin/python3.8. Basically, the link /bin/python3 exists so that legacy programs that look for the python executable in /bin work.

like image 135
C. Aknesil Avatar answered Jul 26 '26 17:07

C. Aknesil


Both /usr/bin/python3 and /bin/python3 are symbolic links to the same Python interpreter. So the only difference between them is path.

like image 22
Ikaruga Avatar answered Jul 26 '26 16:07

Ikaruga