pip install ... ERROR: UnicodeDecodeError: ‘gbk‘ codec can‘t decode/ python setup.py egg_info Check

Refrain__WG發表於2020-09-30

1. pip install 安裝包報錯如下

ERROR: UnicodeDecodeError: 'gbk' codec can't decode/ python setup.py egg_info Check

(base) C:\Users\user>pip download igramscraper
Collecting igramscraper
  Using cached igramscraper-0.3.5.tar.gz (24 kB)
    ERROR: Command errored out with exit status 1:
     command: 'c:\users\user\anaconda3\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\user\\AppData\\Local\\Temp\\pip-download-zwiz5cy9\\igramscraper\\setup.py'"'"'; __file__='"'"'C:\\Users\\user\\AppData\\Local\\Temp\\pip-download-zwiz5cy9\\igramscraper\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\user\AppData\Local\Temp\pip-pip-egg-info-rqfp96y7'
         cwd: C:\Users\user\AppData\Local\Temp\pip-download-zwiz5cy9\igramscraper\
    Complete output (7 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\user\AppData\Local\Temp\pip-download-zwiz5cy9\igramscraper\setup.py", line 8, in <module>
        long_description=Path("README.md").read_text(),
      File "c:\users\user\anaconda3\lib\pathlib.py", line 1200, in read_text
        return f.read()
    UnicodeDecodeError: 'gbk' codec can't decode byte 0xa4 in position 721: illegal multibyte sequence
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

報錯圖片如下:

 

2.解決方案

根據報錯提示,應該是 README.md這個檔案編解碼報錯的問題 (UnicodeDecodeError: 'gbk' codec can't decode),

解決方案:

1、下載好安裝包的壓縮包

2、進入報錯位置,進行處理, 這裡我選擇註釋掉(1.註釋報錯行程式碼  or  2.清空README.md檔案)

3、命令列執行安裝壓縮包  pip install instagram-scraper-master.zip

 

 

 

 

-------------- END -------------------- 

相關文章