Python3安装turtle提示错误:Command "python setup.py egg_info" failed with error code 1
Collecting turtle Using cached https://files.pythonhosted.org/packages/ff/f0/21a42e9e424d24bdd0e509d5ed3c7dfb8f47d962d9c044dba903b0b4a26f/turtle-0.0.2.tar.gz ERROR: Complete output from command python setup.py egg_info: ERROR: Traceback (most recent call last): File "<string>", line 1, in <module> File "/private/var/folders/1b/zd3_1j0d5cn5pz5cd20098ph0000gn/T/pip-install-ckvgi1nr/turtle/setup.py", line 40 except ValueError, ve: ^ SyntaxError: invalid syntax ---------------------------------------- ERROR: Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/1b/zd3_1j0d5cn5pz5cd20098ph0000gn/T/pip-install-ckvgi1nr/turtle/
研究一下turtle的用法,我用的是python3.6 安装了一下,遇到了这个报错,现在记录一下解决办法:
https://pypi.org/project/turtle/#files
下载源包,手动解压,修改setup.py文件再安装。
cd turtle-0.0.2/
ls
vim setup.py
找到图示位置,修改
except (ValueError, ve):
退出,保存
cd .. pip install -e turtle-0.0.2
安装成功
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步