Categories
Python Answers

How to find the full path of the Python interpreter?

Spread the love

Sometimes, we want to find the full path of the Python interpreter.

In this article, we’ll look at how to find the full path of the Python interpreter.

How to find the full path of the Python interpreter?

To find the full path of the Python interpreter, we can use the sys.executable property.

For instance, we write:

import sys

print(sys.executable)

Then print will print the path of the Python interpreter, which is something like '/opt/virtualenvs/python3/bin/python'.

Conclusion

To find the full path of the Python interpreter, we can use the sys.executable property.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published. Required fields are marked *