smcs
smcs

Reputation: 2004

How can I list all Python requirements for a specific folder/package?

I have been working on a project for some time, writing Python scripts spontaneously as I needed them. I'd like to pick out some important ones and put them neatly into a package and then a git repository in a way which makes it easy for co-workers to use them. How can I find out all required Python packages for this specific collection of scripts (which is now a package itself), so I can list them in a requirements.txt? I read up on pip freeze, but this will list everything in the current virtual environment, more than is needed by the scripts I have collected in my new package.

Upvotes: 2

Views: 3110

Answers (1)

Muhammad Hammad
Muhammad Hammad

Reputation: 51

There is a module called pipreqs

pip install pipreqs
pipreqs /path/to/the/folder

Reference: https://pypi.org/project/pipreqs/

Upvotes: 5

Related Questions