![Anaconda プロンプトまたはコマンド プロンプトを使用して Python に Turtle をインストールできませんか?](https://rvso.com/image/1598578/Anaconda%20%E3%83%97%E3%83%AD%E3%83%B3%E3%83%97%E3%83%88%E3%81%BE%E3%81%9F%E3%81%AF%E3%82%B3%E3%83%9E%E3%83%B3%E3%83%89%20%E3%83%97%E3%83%AD%E3%83%B3%E3%83%97%E3%83%88%E3%82%92%E4%BD%BF%E7%94%A8%E3%81%97%E3%81%A6%20Python%20%E3%81%AB%20Turtle%20%E3%82%92%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB%E3%81%A7%E3%81%8D%E3%81%BE%E3%81%9B%E3%82%93%E3%81%8B%3F.png)
python -m pip install turtle
このコマンドを使用して turtle をインストールしますが、エラーが発生します:
C:\Windows\system32>pip install turtle
Collecting turtle
Using cached https://files.pythonhosted.org/packages/ff/f0/21a42e9e424d24bdd0e509d5ed3c7dfb8f47d962d9c044dba903b0b4a26f/turtle-0.0.2.tar.gz
ERROR: Command errored out with exit status 1:
command: 'c:\users\vaibh\appdata\local\programs\python\python37-32\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\vaibh\\AppData\\Local\\Temp\\pip-install-7hujbb79\\turtle\\setup.py'"'"'; __file__='"'"'C:\\Users\\vaibh\\AppData\\Local\\Temp\\pip-install-7hujbb79\\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 pip-egg-info
cwd: C:\Users\vaibh\AppData\Local\Temp\pip-install-7hujbb79\turtle\
Complete output (6 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\vaibh\AppData\Local\Temp\pip-install-7hujbb79\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.
どうすれば修正できますか?
答え1
これはPython2のタートルと互換性のない構文です。ダウンロードできますカメローカルPCに、
それを解凍し、setup.py
40行目を次のように変更します。except (ValueError, ve):
インストールしてみてくださいpip install -e turtle-0.0.2
。