pipreqs icon indicating copy to clipboard operation
pipreqs copied to clipboard

Not adding all required packages that are used in the Django project

Open kushal-h opened this issue 4 years ago • 7 comments

In my project along with Django package, I have installed other packages ie. django-crispy-forms and so on. However, when I use the pipreqs only the Django package is added but not other required packages.

kushal-h avatar Sep 14 '21 06:09 kushal-h

Hi! could you provide a minimum example that I can use to reproduce this error?

alan-barzilay avatar Sep 15 '21 01:09 alan-barzilay

HI,

The problem is as follows.

In my Django project, I have used packages like "django-crispy-forms==1.12.0", "psycopg2==2.8.6", "django-helpdesk==0.2.23" and so on. When I used pipreqs command in* requirements.txt* only django "Django==2.2.24" is added but not the rest as mentioned above.

Best, Kushal H

On Wed, Sep 15, 2021 at 7:12 AM Alan Barzilay @.***> wrote:

Hi! could you provide a minimum example that I can use to reproduce this error?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/bndr/pipreqs/issues/278#issuecomment-919630313, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANPG6UQGVYNCD2RHHZPQR5TUB72WTANCNFSM5D7MQP2A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

kushal-h avatar Sep 15 '21 04:09 kushal-h

Hey @kushal-h, if you could maybe share the project structure for us to get a better idea or if the project is open source then feel free to share the project repo link, this would help us a lot in understanding what is the exact problem.

Thanks :)

jai-dewani avatar Oct 08 '21 19:10 jai-dewani

Link to an example repo: https://github.com/Actionb/pipreqsdjango

Installing the requirements in an empty venv, and then calling pipreqs ./ --print doesn't show the psycopg2==2.8.5 requirement. psycopg2 itself isn't imported or used in the project, so I can hazard a guess why it wouldn't show up. But the module must be installed if you want to use PostgreSQL as the database.

Actionb avatar Dec 08 '21 13:12 Actionb

Have you found the solution?

Martin1458 avatar Mar 19 '22 21:03 Martin1458

Yep: dj_database_url==1.0.0 Django==4.0 django_restful_admin==1.1.3 - djangorestframework==3.14.0 + drf_spectacular==0.24.2

It's adding in the new drf_spectacular but now dropping djangorestframework for my own project.

"from rest_framework import serializers" is mostly definitely in my source along with some actual template serializer code.

matthewsheeran avatar Oct 18 '22 04:10 matthewsheeran