Get all modules/packages used by a python project

Viewed 55977

I have a python GUI application. And now I need to know what all libraries the application links to. So that I can check the license compatibility of all the libraries.

I have tried using strace, but strace seems to report all the packages even if they are not used by the application.

And, I tried python ModuleFinder but it just returns the modules that are inside python2.7 and not system level packages that are linked.

So is there any way I can get all the libraries that are linked from my application?

3 Answers

Or a very easy way is by going to your virtual environment directory (venv) and running on the terminal

pip freeze > requirements.txt

If you are using python3

pip3 freeze > requirements.txt

Related