Ask coding questions

← Back to all posts
Python (with Turtle) - how do I detect python version in run-time?
yshyrsqyn (1)

I entered the following code in Python (with Turtle):
import sys

Running the above code results in the following error:
AttributeError: '<invalid type>' object has no attribute 'version_info' on line 2

The same code works fine in standard Python (i.e. without turtle).

Why does the same code work in standard Python and not in Python (with Turtle)?
Is there an equivalent command that works in Python (with Turtle)?

Thanks a lot!

John_WardWard (202)

I believe python with turtle is a rewrite of the original idle features, so some features may not be available @yshrsqyn

ash15khng (480)

I think Python with Turtle does not have modules.