What is the difference between /usr/bin/python3 and /bin/python3
Asked Answered
M

3

7

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.

Marshall answered 10/8, 2021 at 13:59 Comment(0)
F
7

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.

Fishbein answered 10/8, 2021 at 14:25 Comment(0)
B
2

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

Blaisdell answered 10/8, 2021 at 14:27 Comment(0)
H
0

The difference between /usr/bin/python3 and /bin/python3 is primarily in their intended use and historical convention:

  • /bin/python3 typically contains the system-wide Python interpreter binary, essential for core system functionality.
  • /usr/bin/python3 holds Python interpreter binaries installed by additional software packages or users.

Example:

  • /bin/python3 might be used by the system for essential tasks like system scripts.
  • /usr/bin/python3 might be used by users or applications for specific tasks or additional functionality, such as running third-party scripts or applications.
Hanus answered 5/4 at 12:8 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.