OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Python "turtle" module not found specifically in VS Code

  • Thread starter Thread starter testydungeon
  • Start date Start date
T

testydungeon

Guest
I am running Linux Mint, the problem is that "turtle", which has to be a built-in module is not found in both VS Code and VS Codium, even though I have imported it. The strangest thing is that turtle works when I am running my script through linux's terminal, IDLE or Geany. Everything worked perfectly on my Windows machine.

Other libraries, such as numpy or sympy are imported and working perfectly.

This is a sample script:

Code:
import turtle

turtle.pendown()
for i in range(50):
    turtle.forward(100)
turtle.mainloop()

And this is the error:

Code:
sh-5.2$ /bin/python /home/testydungeon/VSCodium/test/test2.py
Traceback (most recent call last):
  File "/home/testydungeon/VSCodium/test/test2.py", line 1, in <module>
    import turtle
ModuleNotFoundError: No module named 'turtle'

I have tried to install turtle through both IDE with pip and through terminal with apt-get. I have also tried to install tkinter as it seems to have some dependencies with turtle. Import of tkinter also doesn't work btw, giving pretty much the same error.

Python versions: Terminal: 3.10.12 VSCode: 3.11.9
<p>I am running Linux Mint, the problem is that "turtle", which has to be a built-in module is not found in both VS Code and VS Codium, even though I have imported it. The strangest thing is that turtle works when I am running my script through linux's terminal, IDLE or Geany. Everything worked perfectly on my Windows machine.</p>
<p>Other libraries, such as numpy or sympy are imported and working perfectly.</p>
<p>This is a sample script:</p>
<pre><code>import turtle

turtle.pendown()
for i in range(50):
turtle.forward(100)
turtle.mainloop()
</code></pre>
<p>And this is the error:</p>
<pre><code>sh-5.2$ /bin/python /home/testydungeon/VSCodium/test/test2.py
Traceback (most recent call last):
File "/home/testydungeon/VSCodium/test/test2.py", line 1, in <module>
import turtle
ModuleNotFoundError: No module named 'turtle'
</code></pre>
<p>I have tried to install turtle through both IDE with pip and through terminal with apt-get. I have also tried to install tkinter as it seems to have some dependencies with turtle. Import of tkinter also doesn't work btw, giving pretty much the same error.</p>
<p>Python versions: Terminal: 3.10.12 VSCode: 3.11.9</p>
 

Latest posts

Top