LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   python idle can't import Tkinter (https://www.linuxquestions.org/questions/slackware-14/python-idle-cant-import-tkinter-4175533296/)

burdi01 02-06-2015 03:04 PM

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

dugan 02-06-2015 03:07 PM

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?

burdi01 02-06-2015 03:38 PM

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.

bassmadrigal 02-06-2015 04:34 PM

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

burdi01 02-06-2015 04:49 PM

Just downloaded Alien's current install DVD.
Will test and report back tomorrow.
Thks, Dick

dugan 02-06-2015 04:52 PM

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.

burdi01 02-07-2015 04:10 AM

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.:redface:

Thank you for your patience.
Kind regards, Dick :hattip:

bassmadrigal 02-07-2015 12:18 PM

Quote:

Originally Posted by dugan (Post 5313286)
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/


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