pipreqs
pipreqs copied to clipboard
Errors occured when rusing the 'pipreqs' command
(lastFYP_venv) PS C:\Users\Jun\Desktop\Last_FYP> pipreqs
Traceback (most recent call last):
File "C:\Users\Jun\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\Jun\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "C:\Users\Jun\Desktop\Last_FYP\lastFYP_venv\Scripts\pipreqs.exe\__main__.py", line 7, in <module>
File "c:\users\jun\desktop\last_fyp\lastfyp_venv\lib\site-packages\pipreqs\pipreqs.py", line 488, in main
init(args)
File "c:\users\jun\desktop\last_fyp\lastfyp_venv\lib\site-packages\pipreqs\pipreqs.py", line 415, in init
candidates = get_all_imports(input_path,
File "c:\users\jun\desktop\last_fyp\lastfyp_venv\lib\site-packages\pipreqs\pipreqs.py", line 115, in get_all_imports
contents = f.read()
File "C:\Users\Jun\AppData\Local\Programs\Python\Python39\lib\encodings\cp1252.py", line 23, in decode
return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 454: character maps to <undefined>
Hi, I have that error now on multiple machines, too. I did not traceback yet, when it occurred the first time. I updated all packages, but it still occurs. All machines run under windows. But under Linux this is working.
@mingjun1120 Please try add the flag --encoding=utf-8
@kinlamleung Please try add the flag --encoding=utf-8 U mean type
pipreqs --encoding=utf-8
in the terminal?
@mingjun1120 Please try add the flag --encoding=utf-8
Does not work!
Works for me, thanks.