'PyCharm doesn't see module [duplicate]
PyCharm does not see the turtle standard library - a turtle for learning python. (OS Linux Mint)
On another computer (Ubuntu/PyCharm) the code works without errors. On the same run in Spyder and through the terminal: python3 1.py - works. It is PyCharm, installed from the application manager, that is broken.
If you remove PyCharm installed from the application manager and install from the JetBrains website, then the code also works.
I also noticed that PyCharm with JetBrains works with python3.5 (as in the system), and PyCharm from the application manager with python3.9.
What tried:
- select a system interpreter: /usr/bin/python3 (for some reason, the 3.9 version also appears at the specified address)
- reinstall PyCharm from application manager
- reset File > Manage IDE Settings > Restore Default Settings
Nothing helps
import turtle
turtle.shape('turtle')
turtle.forward(50)
turtle.left(90)
turtle.forward(50)
turtle.left(90)
turtle.forward(50)
turtle.right(90)
turtle.forward(50)
turtle.right(90)
turtle.forward(50)
Please help me figure out what is the reason for such capricious behavior of PyCharm
`/usr/bin/python3.9 /home/max/PycharmProjects/tttttttt/1.py Traceback (most recent call last): File "/home/max/PycharmProjects/tttttttt/1.py", line 1, in <module> import turtle ModuleNotFoundError: No module named 'turtle'
Process finished with exit code 1`
Solution 1:[1]
do pip list or pip freeze and check all the installed packages and is turtle installed in current environment or not
I would suggest to use venvs for projects your are trying to work with
python3 -m venv venvsource venv/bin/activatepip3 install turtle
Do this in your terminal. In case if you currently have some venv installed try to activate it with option 2. of the answer
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Izuki13 |
