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 --------------------