Can't import turtle

孤街醉人 提交于 2020-06-09 05:34:08

问题


I'm a complete novice, so I appreciate the answers.
I'm trying to get turtle on my powershell, because that's what the book I'm reading says to do but this shows up,

import : The term 'import' is not recognized as the name of a cmdlet,function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ import turtle
+ ~~~~~~
+ CategoryInfo          : ObjectNotFound: (import:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException

回答1:


You're not in the Python interpreter. You have to start it up, generally by entering the command py. Then you can use the Python environment.




回答2:


import turtle is Python but not PowerShell. Make sure you are in Python, not PowerShell, when you do import turtle.



来源:https://stackoverflow.com/questions/29738967/cant-import-turtle

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!