Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
225 views
in Technique[技术] by (71.8m points)

python - Pip freeze for only project requirements

When I run pip freeze > requirements.txt it seems to include all installed packages. This appears to be the documented behavior.

I have, however, done something wrong as this now includes things like Django in projects that have no business with Django.

How do I get requirements for just this project? or in the future how do I install a package with pip to be used for this project. I think I missed something about a virtualenv.

question from:https://stackoverflow.com/questions/32390291/pip-freeze-for-only-project-requirements

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

pipreqs can save the day for a specific project. Just

pip install pipreqs
#then
pipreqs path/to/project

Github Page


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...