pipreqs
pipreqs copied to clipboard
--use-local creates empty requirements.txt
Hello,
I would like to use --use-local flag to create my requirements.txt. But unfortunately it creates an empty file (Writing 0 requirements). But --debug tells me that it has found 3 libs (Found imports: pyserial, PySimpleGUI, PyYAML).
If I use pipreqs without --use-local I get a requirements file with the 3 entries.
pipreqs version is 0.4.10 Python version is 3.8.5
with --use-local requirements.txt is empty (Writing 0 requirements)
✔ $ python3 -m pipreqs.pipreqs --force --debug --use-local ./
DEBUG: Found packages: {'sys', 're', 'collections', 'datetime', 'PySimpleGUI', 'io', 'itertools', 'random', 'yaml', 'serial', 'time', 'os'}
DEBUG: Found imports: pyserial, PySimpleGUI, PyYAML
DEBUG: Getting package information ONLY from local installation.
DEBUG: Writing 0 requirements: to ./requirements.txt
INFO: Successfully saved requirements file in ./requirements.txt
without --use-local it works (Writing 3 requirements)
✔ $ python3 -m pipreqs.pipreqs --force --debug ./
DEBUG: Found packages: {'random', 'yaml', 'serial', 'time', 'datetime', 're', 'sys', 'PySimpleGUI', 'collections', 'io', 'os', 'itertools'}
DEBUG: Found imports: pyserial, PySimpleGUI, PyYAML
DEBUG: Getting packages information from Local/PyPI
DEBUG: Starting new HTTPS connection (1): pypi.python.org:443
DEBUG: https://pypi.python.org:443 "GET /pypi/pyserial/json HTTP/1.1" 301 122
DEBUG: Starting new HTTPS connection (1): pypi.org:443
DEBUG: https://pypi.org:443 "GET /pypi/pyserial/json HTTP/1.1" 200 5576
DEBUG: Starting new HTTPS connection (1): pypi.python.org:443
DEBUG: https://pypi.python.org:443 "GET /pypi/PySimpleGUI/json HTTP/1.1" 301 122
DEBUG: Starting new HTTPS connection (1): pypi.org:443
DEBUG: https://pypi.org:443 "GET /pypi/PySimpleGUI/json HTTP/1.1" 200 27843
DEBUG: Starting new HTTPS connection (1): pypi.python.org:443
DEBUG: https://pypi.python.org:443 "GET /pypi/PyYAML/json HTTP/1.1" 301 122
DEBUG: Starting new HTTPS connection (1): pypi.org:443
DEBUG: https://pypi.org:443 "GET /pypi/PyYAML/json HTTP/1.1" 200 43612
DEBUG: Writing 3 requirements: pyserial, PySimpleGUI, PyYAML to ./requirements.txt
INFO: Successfully saved requirements file in ./requirements.txt
✔ $ cat requirements.txt
pyserial==3.5
PySimpleGUI==4.38.0
PyYAML==5.4.1
Do you have these packages installed on your environment?
Yes I have:
✔ $ python3 -m pip show pyserial
Name: pyserial
Version: 3.5
Summary: Python Serial Port Extension
Home-page: https://github.com/pyserial/pyserial
Author: Chris Liechti
Author-email: [email protected]
License: BSD
Location: /home/hipc/.local/lib/python3.8/site-packages
Requires:
Required-by:
✔ $ python3 -m pip show PySimpleGUI
Name: PySimpleGUI
Version: 4.34.0
Summary: Python GUIs for Humans. Launched in 2018. It's 2021 & PySimpleGUI is an ACTIVE project. Super-simple to create custom GUI's. 300 Demo programs & Cookbook for rapid start. Extensive documentation. Main docs at www.PySimpleGUI.org. Your success is the focus. Examples using Machine Learning (GUI, OpenCV Integration, Chatterbot), Rainmeter Style Desktop Widgets, Matplotlib + Pyplot, PIL support, add GUI to command line scripts, PDF & Image Viewers. Great for beginners & advanced GUI programmers
Home-page: https://github.com/PySimpleGUI/PySimpleGUI
Author: PySimpleGUI
Author-email: [email protected]
License: UNKNOWN
Location: /home/hipc/.local/lib/python3.8/site-packages
Requires:
Required-by:
✔ $ python3 -m pip show PyYAML
Name: PyYAML
Version: 5.4.1
Summary: YAML parser and emitter for Python
Home-page: https://pyyaml.org/
Author: Kirill Simonov
Author-email: [email protected]
License: MIT
Location: /home/hipc/.local/lib/python3.8/site-packages
Requires:
Required-by: knack, ansible, ansible-lint
I'm facing the same problem. With "--use-local" the output contains only 4 lines, whatsmore the version information is different to the enviromment.
I have the same issue :( also using "--use-local" .
DEBUG: Getting package information ONLY from local installation. DEBUG: Writing 0 requirements: to .\requirements.txt INFO: Successfully saved requirements file in .\requirements.txt