问题解决:Command “python setup.py eg9_ info” failed with error code 1 in /tmp/pip-build- 0aa4y6yw/aiohttp/
问题描述
在用pip下载第三方包 geoip2时,报错;在更新pip时依旧报相似错误。
错误信息:
Complete output from command python setup.py egg. info :
Traceback (most recent call last) :
File “”, Line 1,in
File ”/ tmp/pip- build- 0aa4y 6yw/ aiohttp/setup.py", Line 1
NO_ EXTENSIONS: bool = bool(os . environ.get(“AIOHTTP_ NO_ EXTENSIONS” ))
SyntaxError: invalid syntax
Command “python setup.py eg9_ info” failed with error code 1 in /tmp/pip-build- 0aa4y6yw/aiohttp/
You are using pip version 8.1.1, however. version, 24.0 is available
upgrading via the ‘pip install --upgrade pip’ command .
1. pip install 超时
pip install geoip2
解决:加个清华源
pip install geoip2 -i https://pypi. tuna. ts inghua . edu. cn/simple
2. pip install geoip2报错
Command “python setup.py eg9_ info” failed with error code 1 in /tmp/pip-build- 0aa4y6yw/aiohttp/
You are using pip version 8.1.1, however. version, 24.0 is available upgrading via the ‘pip install --upgrade pip’ command .
需要更新pip
pip install --upgrade pip -i https://pypi. tuna. ts inghua . edu. cn/simple
3. pip更新报错
在更新pip时依旧报错:Command “python setup.py e9g_ info” failed with error code 1 in / tmp/pip . build LiYunU/pip/
问题解决
问题原因:在pip21版本开始pip不再支持python2。
解决步骤:
- 使用原先旧的执行pip install pip==20.3.3可以直接升级上去
pip install pip==20.3.3
- 然后下载第三方包
pip install geoip2 -i https://pypi. tuna. ts inghua . edu. cn/simple