I am trying to make a very first desktop application using tkinter in pycharm like this.
from tkinter import *
root = Tk()
mLabel = Label(root, text="This is Header")
mLabel.pack
mLabel.mainloop()
But I got an exception saying
ImportError: No module named '_tkinter', please install the python3-tk package
And I tried to install the python3-tk like this
sudo apt-get install python3-tk
But I then got an error about install-info
ronem:::ronem:~$ sudo apt-get install python3-tk
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
libfftw3-single3:i386 libgomp1:i386 libpam-systemd:i386
libpulsedsp:i386 libtdb1:i386
libwebrtc-audio-processing-0:i386
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
blt tk8.6-blt2.5
Suggested packages:
blt-demo tix python3-tk-dbg
The following NEW packages will be installed:
blt python3-tk tk8.6-blt2.5
0 upgraded, 3 newly installed, 0 to remove and 437 not upgraded.
1 not fully installed or removed.
Need to get 0 B/604 kB of archives.
After this operation, 2,117 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up install-info (6.1.0.dfsg.1-5) ...
/usr/sbin/update-info-dir: 3: /etc/environment: CLASSPATH: not found
dpkg: error processing package install-info (--configure):
subprocess installed post-installation script returned error exit
status 127
Errors were encountered while processing:
install-info
E: Sub-process /usr/bin/dpkg returned an error code (1)
ronem:::ronem:~$
Please guide me through What I am missing
Open the terminal and type:
Check if there is a line in
/etc/environment
that contains the stringCLASSPATH
which doesn't belong in/etc/environment
. You should comment out everything from/etc/environment
except for the first line (the setting ofPATH
which starts withPATH=
) by preceding each line to be commented out by a#
character. Open the/etc/environment
file for editing in nano text editor with the following command:Nano editor keyboard shortcuts
Use the keyboard combination Ctrl + O and after that press Enter to save the file to its current location.
Use the keyboard combination Ctrl + X to exit nano.