4

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?

1
  • pip freeze > requirements.txt generates a single list of the specific packages used by your current Python interpreter (which can be a venv + base interpreter) on which pip is installed. While if you use setup.py the install-requires can list the minimum requirements. Basically your question is how to generate requirements minimum dependencies of the project and not from the current interpreter/venv. I don't know if that is possible using pip. See this question and this one. Commented Aug 13, 2020 at 23:58

1 Answer 1

5

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:

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.