pipreqs: Error while creating requirements.txt
Hello!
C:\Users\ipetrash\Desktop\PyScripts\hideme.ru-proxy-list>pipreqs C:\Users\ipetrash\Desktop\PyScripts\hideme.ru-proxy-list
Traceback (most recent call last):
File "C:\Python34\lib\runpy.py", line 170, in _run_module_as_main
"__main__", mod_spec)
File "C:\Python34\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Python34\Scripts\pipreqs.exe\__main__.py", line 9, in <module>
File "C:\Python34\lib\site-packages\pipreqs\pipreqs.py", line 178, in main
init(args)
File "C:\Python34\lib\site-packages\pipreqs\pipreqs.py", line 157, in init
local = get_import_local(candidates)
File "C:\Python34\lib\site-packages\pipreqs\pipreqs.py", line 112, in get_import_local
local = get_locally_installed_packages()
File "C:\Python34\lib\site-packages\pipreqs\pipreqs.py", line 105, in get_locally_installed_packages
'version': package[1].replace(".dist", ""),
IndexError: list index out of range
Used for: https://github.com/gil9red/hideme.ru-proxy-list
Sincerely yours, gil9red
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Reactions: 2
- Comments: 23 (6 by maintainers)
For others who might have similar problem. utf-8 have not worked for me, but with iso-8859-1 it worked:
pipreqs --encoding=iso-8859-1 ./–encoding=utf-8 worked. I’m still reviewing the .txt, I think it’s actually correct.
Can you post the generated requirements.txt? Can you try with --encoding=utf-8 options, and see if the error persists
Same issue for me in Linux Mint 17. Some debug info:
@gil9red fix works for me. Patch below:
This seems to have worked for me
pipreqs --encoding=utf-8-sig ./But it isn’t generating the correct requirements
Windows 10 x64, Python 3.5 x64. The same bug.