Python common exception handling pip install turtle installation failed

When we install turtle, the following situations often occur

SyntaxError: invalid syntax
File “…/turtle/setup.py”, line 40

This is because after Python3, except cannot accept statements without ()
Insert picture description here

How to solve it?

First download the compressed package of turtle-0.0.2.tar.gz from the Internet, unzip it and put it on the desktop after downloading

Insert picture description here
Open turtle-0.0.2, edit setup.py, Insert picture description here
and change except ValueError, ve: to except (ValueError, ve):
Insert picture description here
Ctrl+s
at line 40, and then install the project interpreter in pycharm. , Or pip install installation in cmd The
Insert picture description here
installation is successful!

Guess you like

Origin blog.csdn.net/JasonZ227/article/details/109850234