Skip to content
Advertisement

Is there a way to get directory package dependencies in python?

I am aware that pip freeze > requirements.txt exists, yet that that prints out my system packages, of which only a few my directory/ project needs.

I am not using a virtualenv so I’m pretty sure I can’t print out local packages like that.

I also know that pipdeptree exsists but I also don’t see how that solves my problem?

Advertisement

Answer

I believe tools like the following could help:

As far as I can tell, these tools read the code in the directory and try to figure out the dependencies required based on the import statements they found in the code.

Related:

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement