Python Interpreter: ModuleNotFoundError: No module named '_tkinter' - python

When I run import tkinter I get this error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.9/tkinter/__init__.py", line 37, in <module>
import _tkinter # If this fails your Python may not be configured for Tk
ModuleNotFoundError: No module named '_tkinter'
Ruuning apt-get install python3-tk doesn't sove this issue.
Running Python 3.9 on Debian Experimental

Maybe you can try import tkinter instead of import _tkinter

Related

ModuleNotFoundError: No module named '_sqlite3' Error when try to import sqlite3 and Django in Ubuntu

I tried to Create Django Project. I'm able to create project but not able to run the runserver command. I got below error. I also tried to import sqlite3 got same error
>>> import sqlite3
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.11/sqlite3/__init__.py", line 57, in <module>
from sqlite3.dbapi2 import *
File "/usr/local/lib/python3.11/sqlite3/dbapi2.py", line 27, in <module>
from _sqlite3 import *
ModuleNotFoundError: No module named '_sqlite3'
>>>
Python version: Python 3.11.0
As Chris suspected the Python 3.11 is causing the issues I don't know why but I just downgraded to 3.8.10 and it resolved the issue.

No module named '_curses'

Traceback (most recent call last):
File "c:\the stuff\DarkOS-main\bootscreen.py", line 21, in <module>
from curses import *
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.1008.0_x64__qbz5n2kfra8p0\lib\curses\__init__.py", line
13, in <module>
from _curses import *
ModuleNotFoundError: No module named '_curses'
How do you get '_curses' on windows?
Some code:
from curses import *
It is very simple. You need to install the library by running
pip install windows-curses
You could type the above command in command prompt for Vscode or on the terminal in Pycharm

ModuleNotFoundError: No module named '_curses'

I am using windows and would like to use the curses package,I installed it with the command:
pip install windows-curses
but when I try to import curses
it gives an eror from the python source file
__init__.py
here's the eror:
C:\Users\user\PycharmProjects\snake\venv\Scripts\python.exe C:/Users/user/AppData/Local/Programs/Python/Python39/Lib/curses/__init__.py
Traceback (most recent call last):
File "C:\Users\user\AppData\Local\Programs\Python\Python39\Lib\curses\__init__.py", line 12, in <module>
from _curses import *
ModuleNotFoundError: No module named '_curses'
Can someone please help me fix it?

Error Installing Idle3.6

I am running Linux Mint 18.1 and python 3.6.
I would like to install idle3.6 but after installing this package
i get the following error :
Traceback (most recent call last):
File "/usr/local/lib/python3.6/idlelib/pyshell.py", line 4, in
<module>
from tkinter import *
File "/usr/local/lib/python3.6/tkinter/__init__.py", line 36, in
<module>
import _tkinter # If this fails your Python may not be configured for
Tk
ModuleNotFoundError: No module named '_tkinter'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/bin/idle3.6", line 3, in <module>
from idlelib.pyshell import main
File "/usr/local/lib/python3.6/idlelib/pyshell.py", line 7, in
<module>
"Your Python may not be configured for Tk. **", file=sys.__stderr__)
NameError: name 'sys' is not defined
what i understand is that i need to install the tkinter package.
what i have tried so far is this command:
sudo apt-get install python3-tk
but it i still get the above error.
which command should i use to install tkinter for python 3.6?
Here is a Linux Mint IDLE version: https://community.linuxmint.com/software/view/idle-python3.5, since you are using Linux Mint. There's not yet a idle-python3.6 version.

ImportError: No module named 'version' during installation

I'm trying to install SMOP on Anaconda3 (Python 3.5.1), but it fails due to the following error:
[Anaconda3] C:\Users\IanHacker\Downloads\smop-0.29>python setup.py install
Traceback (most recent call last):
File "setup.py", line 4, in <module>
from smop.version import __version__
File "C:\Users\IanHacker\Downloads\smop-0.29\smop\__init__.py", line 4, in <module>
import version
ImportError: No module named 'version'
"pip install smop" and "easy_install smop" return the same error.
I referred to ImportError: No module named 'version', so I changed the content of __init__.py:
import version
import parse,resolve,backend,main
from version import __version__
to:
__version__ = '0.29'
import parse,resolve,backend,main
... then, I got:
[Anaconda3] C:\Users\IanHacker\Downloads\smop-0.29>python setup.py install
Traceback (most recent call last):
File "setup.py", line 4, in <module>
from smop.version import __version__
File "C:\Users\IanHacker\Downloads\smop-0.29\smop\__init__.py", line 6, in <module>
import parse,resolve,backend,main
ImportError: No module named 'parse'
I don't even know if the __version__ issue has been solved.
Even if it has been solved, I don't know what to replace "parse" with.
And ... do I have to keep replacing until this works? Is there any better way to solve this?
*For those who installed Anaconda, could you try to run the command and check if the same error happens? Am I the only one who gets this error?

Categories