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.38k stars 388 forks source link

Empty requirements.txt file #221

Closed ashu-tosh-kumar closed 3 years ago

ashu-tosh-kumar commented 3 years ago

I am trying to create a requirements.txt file for my project. Using --debug as argument, I can see that pyreqs is detecting the packages but it's not writing anything to the requirements.txt file. It is creating an empty file.

pipreqs Issue Video

icedrowning commented 3 years ago

same as @ashu-tosh-kumar bro, Have you ever solve the problem? At current dir,which has my python file,I used [pipreqs . --encoding=utf8 --force] But the requirements.txt is empty

icedrowning commented 3 years ago

sorry it was my bad. python file forget to ad .py postfix. after added,it works normally

ashu-tosh-kumar commented 3 years ago

Hi, I didn't solve the problem. I will try adding .py as you mentioned.

alan-barzilay commented 3 years ago

Pipreqs currently does not attempt to open any file that is not a .py file. I will close this issue but feel free to reopen it if adding the .py extension hasn't solved the issue

khoo-teewan commented 2 years ago

I am trying to run Pipreqs in the powershell and under the directory where my python program (.py files) resides. I got a blank requirement.txt file. Not sure what is the problem. Anyone can advise..

LAKSHAYNE commented 2 years ago

facing the same issue , kept my file alone in the directory "creator" and ran pipreqs 'creator' file was created but was blank!!!!!

PARKER-X commented 1 year ago

same issue can u send me solution for this issue

andrii-kliuha commented 1 year ago

I had the same issue. And I found out that pipreqs works differently than pip freeze. In order to generate Not an empty file with pipreqs command you should have some imports in your project's files, because pipreqs's looking only for modules that are directly used in a project. For instance, you've installed a bunch of libraries and in one of your .py file you have 'from selenium import webdriver' it will generate txt with selenium only.

saisasi-choda commented 1 month ago

im having the similar issue any inputs to solve the problem