python下载第三方库的时候报错ERROR: Command errored out with exit status 1: python setup.py egg_info Check the

python下载第三方库的时候报错ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

报错 的全部信息

ERROR: Command errored out with exit status 1:
     command: /Library/Frameworks/Python.framework/Versions/3.8/bin/python3.8 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/t1/tt6kbsj11wv29p0v142n8c2h0000gn/T/pip-install-rclg4cgk/turtle/setup.py'"'"'; __file__='"'"'/private/var/folders/t1/tt6kbsj11wv29p0v142n8c2h0000gn/T/pip-install-rclg4cgk/turtle/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 /private/var/folders/t1/tt6kbsj11wv29p0v142n8c2h0000gn/T/pip-pip-egg-info-s4b4btfz
         cwd: /private/var/folders/t1/tt6kbsj11wv29p0v142n8c2h0000gn/T/pip-install-rclg4cgk/turtle/
    Complete output (6 lines):
    Traceback (most recent call last):
      File "", line 1, in 
      File "/private/var/folders/t1/tt6kbsj11wv29p0v142n8c2h0000gn/T/pip-install-rclg4cgk/turtle/setup.py", line 40
        except ValueError, ve:
                         ^
    SyntaxError: invalid syntax
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

然后再网上搜索了非常多的方法,试过了所有的方法
第一种是pip版本过低的原因,报错提到version:pip install—upgrade pip
第二中网上是说setuptools版本过低:pip install --upgrade setuptools
但注意以上两种方法都没有解决我的问题

因为是mac的原因,内带python,所以甚至考虑了版本冲突的问题,但最后还是没有解决,但今天突然想到一个问题,就是我要安装的包是turtle,因为之前没有接触这个包,会不会这个包压根儿就不是第三方包,我直接在程序使用了,发现代码没有问题,也没报错。至此,该问题解决。这个错误离谱就在于这个报错非常迷惑,并不是直接报错说明该包是内置的。另外一定要测试一哈,可以选择将以前存在的包删除一哈,再使用pip来下载尝试。如果没报错,就要去寻找其他的思路了。当然如果急需某些包,尝试直接去网上下载这些轮子,而不是pip那种方式进行下载。

你可能感兴趣的:(男,学生,python)