How to use the which Command (Ubuntu, macOS) In Python
On Unix-based systems like Ubuntu and macOS, you can use the which
command to find the path of the Python interpreter.
Steps:
- Open Terminal.
- Type the command.
Example:
which python
# or for Python 3
which python3
Explanation:
- The
which
command returns the path of the executable that would run if the command was entered.
Contact Us