Code Yarns ‍👨‍💻
Tech BlogPersonal Blog

How to view modules loaded by a Python program

📅 2013-May-29 ⬩ ✍️ Ashwin Nanjappa ⬩ 📚 Archive

The Python program has a useful parameter: -v When Python is launched with this parameter to run a Python program, it prints out all the Python modules and dynamic libraries that are loaded during the executing. This can be useful to see exactly which Python files and shared library files are loaded and in which order. This parameter also prints out the modules as they are cleaned up at the end of program execution.

$ python -v foo.py

Tried with: Python 2.7.3 and Ubuntu 12.04 LTS