You would probably also want this:
import sys
print(sys.path)
Or as a one liner from the terminal:
python -c "import sys; print('\n'.join(sys.path))"
Caveat: If you have multiple versions of Python installed you should use a corresponding command python2
or python3
.
More Related Contents:
- How does python find a module file if the import statement only contains the filename?
- How do I import a module given the full path?
- How can I import other Python files?
- What exactly is a “raw string regex” and how can you use it?
- Unable to import a module that is definitely installed
- Can modules have properties the same way that objects can?
- Add to python path mac os x
- What do I need to read Microsoft Access databases using Python?
- Importing modules: __main__ vs import as module
- How do I import other Python files?
- PYTHONPATH on Linux [closed]
- sys.path different in Jupyter and Python – how to import own modules in Jupyter?
- How to get filename of the __main__ module in Python?
- Import Error: No module named django
- Python import modules from a higher level package
- What does if __name__ == “__main__”: do in Python?
- Prevent Python from caching the imported modules
- django import error – No module named core.management
- Anaconda: Permanently include external packages (like in PYTHONPATH)
- PYTHONPATH not working for sudo on GNU/Linux (works for root)
- Python: ‘Private’ module in a package
- How do I extend a python module? Adding new functionality to the `python-twitter` package
- Effect of using sys.path.insert(0, path) and sys.path(append) when loading modules
- set pythonpath before import statements
- Add directory to Python path in PyCharm?
- How to move all modules to new version of Python (from 3.6 to 3.7)
- Importing a library from (or near) a script with the same name raises “AttributeError: module has no attribute” or an ImportError or NameError
- How can I do relative imports in Python?
- How do I import a Python script from a sibling directory?
- Recursive version of ‘reload’