LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 02-06-2015, 03:04 PM   #1
burdi01
Member
 
Registered: Dec 2010
Location: The Netherlands
Distribution: Slackware Current64, PartedMagic, Xubuntu
Posts: 465

Rep: Reputation: 114Reputation: 114
python idle can't import Tkinter


Current multilib, but also on 32bit:

Code:
root@riposo:~/works# python
Python 2.7.5 (default, May 29 2013, 02:28:51) 
[GCC 4.8.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> quit()
root@riposo:~/works# idle
** IDLE can't import Tkinter.  Your Python may not be configured for Tk. **
root@riposo:~/works#
I searched in vain for a solution ...
Regards, Dick
 
Old 02-06-2015, 03:07 PM   #2
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,228

Rep: Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320
Does it work as a normal user, and not as root?

Have you done a full install, or did you leave some packages (such as tcl/tk) out?
 
Old 02-06-2015, 03:38 PM   #3
burdi01
Member
 
Registered: Dec 2010
Location: The Netherlands
Distribution: Slackware Current64, PartedMagic, Xubuntu
Posts: 465

Original Poster
Rep: Reputation: 114Reputation: 114
Thank you for the quick response.
Things do not work for a non-root user either.
I run a "selective" install.
Installing all 6 packages from the tcl disk set did not help.
There is nothing related in /var/log/messages.
 
Old 02-06-2015, 04:34 PM   #4
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
Works fine here.

Code:
jbhansen@craven-moorhead:~$ python
Python 2.7.5 (default, May 29 2013, 02:28:51) 
[GCC 4.8.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> quit()
jbhansen@craven-moorhead:~$ idle
jbhansen@craven-moorhead:~$
idle launches a python shell containing the following

Code:
Python 2.7.5 (default, May 29 2013, 02:28:51) 
[GCC 4.8.0] on linux2
Type "copyright", "credits" or "license()" for more information.
>>>
Seems like you're missing some dependencies (which is why a full install is always recommended).

Anyway, tkinter should be included in the main python package, so I don't know why it wouldn't be on your system.

Code:
/var/log/packages/python-2.7.5-x86_64-1:usr/lib64/python2.7/lib-tk/test/test_tkinter/
/var/log/packages/python-2.7.5-x86_64-1:usr/lib64/python2.7/lib-tk/test/test_tkinter/test_loadtk.pyo
/var/log/packages/python-2.7.5-x86_64-1:usr/lib64/python2.7/lib-tk/test/test_tkinter/test_text.pyo
/var/log/packages/python-2.7.5-x86_64-1:usr/lib64/python2.7/lib-tk/test/test_tkinter/__init__.py
/var/log/packages/python-2.7.5-x86_64-1:usr/lib64/python2.7/lib-tk/test/test_tkinter/test_text.pyc
/var/log/packages/python-2.7.5-x86_64-1:usr/lib64/python2.7/lib-tk/test/test_tkinter/__init__.pyo
/var/log/packages/python-2.7.5-x86_64-1:usr/lib64/python2.7/lib-tk/test/test_tkinter/test_text.py
/var/log/packages/python-2.7.5-x86_64-1:usr/lib64/python2.7/lib-tk/test/test_tkinter/__init__.pyc
/var/log/packages/python-2.7.5-x86_64-1:usr/lib64/python2.7/lib-tk/test/test_tkinter/test_loadtk.pyc
/var/log/packages/python-2.7.5-x86_64-1:usr/lib64/python2.7/lib-tk/test/test_tkinter/test_loadtk.py
/var/log/packages/python-2.7.5-x86_64-1:usr/lib64/python2.7/lib-dynload/_tkinter.so
Maybe try reinstalling python? Grab it from here.

upgradepkg --reinstall python-2.7.5-x86_64-1.txz
 
Old 02-06-2015, 04:49 PM   #5
burdi01
Member
 
Registered: Dec 2010
Location: The Netherlands
Distribution: Slackware Current64, PartedMagic, Xubuntu
Posts: 465

Original Poster
Rep: Reputation: 114Reputation: 114
Just downloaded Alien's current install DVD.
Will test and report back tomorrow.
Thks, Dick
 
Old 02-06-2015, 04:52 PM   #6
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,228

Rep: Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320
There's a MANIFEST.bz2 files on the DVD and on the mirrors. It will tell you which package the files that bassmadrigal listed are in.
 
Old 02-07-2015, 04:10 AM   #7
burdi01
Member
 
Registered: Dec 2010
Location: The Netherlands
Distribution: Slackware Current64, PartedMagic, Xubuntu
Posts: 465

Original Poster
Rep: Reputation: 114Reputation: 114
On a fresh clone of my Current Multilib system I "slackpkg" installed the tcl and tk packages. Now idle starts OK.
Yesterday's failures must have been caused by the fact that the test system was already "contaminated" by previous tests.

Thank you for your patience.
Kind regards, Dick
 
Old 02-07-2015, 12:18 PM   #8
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
Quote:
Originally Posted by dugan View Post
There's a MANIFEST.bz2 files on the DVD and on the mirrors. It will tell you which package the files that bassmadrigal listed are in.
The files I listed were grepped from /var/log/packages, so it showed what package they belonged to

Code:
/var/log/packages/python-2.7.5-x86_64-1:usr/lib64/python2.7/lib-tk/test/test_tkinter/
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] [Python] Importing and using tkinter Mr. Alex Programming 3 09-22-2012 08:43 AM
How do I import Tkinter into Python mugglemage Linux - Software 5 07-02-2008 08:47 AM
Python: Idle: ImportError: cannot import name sleep Joe Soap Linux - Newbie 1 10-01-2005 01:52 AM
Python and Tkinter 1337 Twinkie Fedora 2 08-03-2004 11:35 AM
Python: Tkinter. Chu Programming 0 11-10-2003 01:56 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 12:12 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration