When I use pipreqs
, I have this problem. I use anaconda and Russian Windows.
root@DESKTOP-ETLLRI1 C:\Users\root\Desktop\resumes
$ pipreqs C:\Users\root\Desktop\resumes
Traceback (most recent call last):
File "C:\Users\root\Anaconda3\Scripts\pipreqs-script.py", line 9, in <module>
sys.exit(main())
File "C:\Users\root\Anaconda3\lib\site-packages\pipreqs\pipreqs.py", line 396, in main
init(args)
File "C:\Users\root\Anaconda3\lib\site-packages\pipreqs\pipreqs.py", line 341, in init
extra_ignore_dirs=extra_ignore_dirs)
File "C:\Users\root\Anaconda3\lib\site-packages\pipreqs\pipreqs.py", line 75, in get_all_imports
contents = f.read()
File "C:\Users\root\Anaconda3\lib\encodings\cp1251.py", line 23, in decode
return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x98 in position 1206: character maps to <undefined>
You can pass an encoding argument to pipreqs
to set the encoding to use to open files.
Python3 files are usually encoded as utf-8, so execute
pipreqs --encoding=utf8 C:\Users\root\Desktop\resumes
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With