bndr / pipreqs

pipreqs - Generate pip requirements.txt file based on imports of any project. Looking for maintainers to move this project forward.
Apache License 2.0
6.1k stars 381 forks source link

PyPDF2 is missing from output with --use-local (although installed) #196

Open bersbersbers opened 4 years ago

bersbersbers commented 4 years ago

PyPDF2 is installed and I import it in my project, but when I use pipreqs --use-local, it is missing from the output, while it is included in the output of pipreqs:

user@host:~/temp> pip freeze | grep PyPDF2
PyPDF2==1.26.0

user@host:~/temp> ll
total 4
-rw-r--r-- 1 user group 38 Mar  6 12:46 my.py

user@host:~/temp> cat my.py 
import PyPDF2
print(PyPDF2._version)

user@host:~/temp> python my.py
<module 'PyPDF2._version' from '/home/user/.pyenv/versions/3.7.6/lib/python3.7/site-packages/PyPDF2/_version.py'>

user@host:~/temp> pipreqs --print
PyPDF2==1.26.0
INFO: Successfully output requirements

user@host:~/temp> pipreqs --print --use-local

INFO: Successfully output requirements
natss commented 4 years ago

I have the absolutely same thing with scikit-learn. pipreqs doesn't see it in the environment.

$ pip freeze | grep scikit
scikit-learn==0.23.1

$ pipreqs --print | grep scikit
INFO: Successfully output requirements
scikit_learn==0.23.1
$ pipreqs --print --use-local| grep scikit
INFO: Successfully output requirements

P.S. pipeqs is also installed in this project's enviroments .