How to install Tkinter on debian sid? - python

I need to install tkinter on debian. After some research[1][2], I noticed that Tkinter should be automatically installed with Python. However, when I try to import the module, I get the following:
>>> import tkinter
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named tkinter
When I try to import Tkinter, the error changes:
>>> import Tkinter
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 42, in <module>
raise ImportError, str(msg) + ', please install the python-tk package'
ImportError: No module named _tkinter, please install the python-tk package
So I try to install the python-tk package via apt-get. Another error comes out:
E: Failed to fetch http://ftp.us.debian.org/debian/pool/main/t/tk8.5/tk8.5_8.5.14-2_amd64.deb 404 Not Found [IP: 64.50.233.100 80]
I'm on debian sid, amd64.

It seems your packages list is out of date, first retrieve new lists of packages by:
apt-get update
And then install tk package with:
apt-get install python-tk
Or, for Python 3:
apt-get install tk

I followed Omid Raha's answer, but I had to use
apt-get update
apt-get install python3-tk
in order to get it working in python3.

Related

ImportError: No module named tflite_runtime.interpreter

Following this official TF Guide: https://www.tensorflow.org/lite/guide/python
Tried this method as well: https://github.com/tensorflow/examples/tree/master/lite/examples/image_classification/raspberry_pi
However, I am stuck with the error ImportError: No module named tflite_runtime.interpreter.
In my py file I have
import tflite_runtime.interpreter as tflite.
Hardware: Raspberry Pi Zero 2 W
https://pypi.org/project/tflite-runtime was updated recently.
I think the following just work.
$ pip3 install tflite-runtime
Solution
pip3 install tflite-runtime
followed by
sudo apt-get install libatlas-base-dev
To avoid error: Traceback (most recent call last): File "/home/pi/.local/lib/python3.7/site-packages/numpy/core/__init__.py", line 22, in <module> from . import multiarray

Module tkinter working with python 3.5, but not python 3.6

I am on Ubuntu 16.04 and have just installed installed python 3.6. via apt.
When importing tkinter, I get the oft-seen error
ImportError: No module named '_tkinter', please install the python3-tk package
Trouble is, the python3-tk package is installed.
$> python3.5 -c "import tkinter"
[no output]
$> python3.6 -c "import tkinter"
Traceback (most recent call last):
File "/usr/lib/python3.6/tkinter/__init__.py", line 37, in <module>
import _tkinter
ModuleNotFoundError: No module named '_tkinter'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/lib/python3.6/tkinter/__init__.py", line 39, in <module>
raise ImportError(str(msg) + ', please install the python3-tk package')
ImportError: No module named '_tkinter', please install the python3-tk package
How can I fix this?
I solved this problem by restoring /usr/lib/python3.6 from backup. I've now seen it several times that when stuff goes missing from there, the package manager cannot reinstall it, despite claiming to do so.

Python cannot installing dbus package

I tried many things but I could not install dbus package for python3.
I believe this command install the dbus for python3:
sudo apt-get install python3-dbus-dbg
However I still get this error:
>>> import dbus
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named 'dbus'

ImportError on importing pycurl

I'm getting a traceback whenever trying to import pycurl, any help on solving the issue would be greatly appreciated.
Version of Python is 2.7
>>> import pycurl
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: /usr/local/lib/libcurl.so.4: symbol SSLv2_client_method, version OPENSSL_1.0.0 not defined in file libssl.so.1.0.0 with link time reference
On debian for me helped this:
apt-get install -y libssl-dev

Python3 tkinter import error on linux "import tkinter ModuleNotFoundError: No module named 'tkinter'"

I have looked in to it Example but can't find out.
I am using python3 on linux Ubuntu(PopOs)
sudo apt-get install python3-tk dit not work
Traceback (most recent call last):
File "Test.py", line 3, in
import tkinter
ModuleNotFoundError: No module named 'tkinter'
Install from python.org Here
When installing click custom and tick everything, Including tk and tcl libraries.

Categories

Resources