python-tk not installs correctly

Discussions Regarding Software

Moderator: Moderators

python-tk not installs correctly

Postby dkuku » Thu Apr 25, 2013 16:39

I'm playng with python and tk and got a problem importing tk
What i've done
equo install python-tk #installs python-tk for python 3
equo install python-tk:2.7
bot now when I try to inport tkinter I've got an error
Code: Select all
>>> import Tkinter
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib64/python2.7/lib-tk/Tkinter.py", line 39, in <module>
    import _tkinter # If this fails your Python may not be configured for Tk
ImportError: No module named _tkinter
>>>
same when running idle wich is tk based and installs when you install python-tk (because of that it was hard to find it in entropy):
Code: Select all
idle2.7
** IDLE can't import Tkinter.  Your Python may not be configured for Tk. **
kuku@kl$ idle3.3
** IDLE can't import Tkinter.  Your Python may not be configured for Tk. **
kuku@kl$
dkuku
Baby Hen
 
Posts: 9
Joined: Fri May 12, 2006 7:53

Re: python-tk not installs correctly

Postby sabayonino » Thu Apr 25, 2013 17:27

dev-lang/python was build without "tk" support

see https://packages.sabayon.org/show/pytho ... 5,standard USE Flag

you can file a bug to enable TK support
User avatar
sabayonino
Sagely Hen
 
Posts: 2436
Joined: Sun Sep 21, 2008 1:12
Location: Italy

Re: python-tk not installs correctly

Postby dkuku » Thu Apr 25, 2013 17:44

filed a bug - thanks
dkuku
Baby Hen
 
Posts: 9
Joined: Fri May 12, 2006 7:53

Re: python-tk not installs correctly

Postby Stupot » Thu Apr 25, 2013 19:00

the tk python bindings are provided by a different package to be installed. You shouldn't need to file that bug, what you did to install python-tk should be correct.

What is the output of the following:

Code: Select all
equo search python-tk
Stupot
Sagely Hen
 
Posts: 1511
Joined: Wed Feb 14, 2007 3:44
Location: St. Louis, MO, USA

Re: python-tk not installs correctly

Postby sabayonino » Thu Apr 25, 2013 20:09

Code: Select all
/usr/lib64/python2.7/lib-tk/Tkinter.py


lib-tk mod is missing .


https://packages.sabayon.org/show/pytho ... -show-what

he can try portage and make sure if it works
Code: Select all
USE="tk" emerge dev-lang/python:2.7
:roll:
User avatar
sabayonino
Sagely Hen
 
Posts: 2436
Joined: Sun Sep 21, 2008 1:12
Location: Italy

Re: python-tk not installs correctly

Postby dkuku » Thu Apr 25, 2013 22:37

Code: Select all
emerge dev-lang/python:2.7
Calculating dependencies... done!
[ebuild   R    ] dev-lang/python-2.7.3-r3  USE="tk* -berkdb*"

!!! Multiple package instances within a single package slot have been pulled
!!! into the dependency graph, resulting in a slot conflict:

dev-lang/python:2.7

  (dev-lang/python-2.7.3-r3::gentoo, ebuild scheduled for merge) pulled in by
    (no parents that aren't satisfied by other packages in this slot)

  (dev-lang/python-2.7.3-r3::gentoo, installed) pulled in by
    =dev-lang/python-2.7.3-r3[-tk] required by (dev-lang/python-tk-2.7.3-r3::sabayon-distro, installed)


!!! Enabling --newuse and --update might solve this conflict.
!!! If not, it might help emerge to give a more specific suggestion.


I'll try it with python 3.2 because it isn't used by the system.
That should semi solve for me, but the problem will still exist for other users.
dkuku
Baby Hen
 
Posts: 9
Joined: Fri May 12, 2006 7:53

Re: python-tk not installs correctly

Postby Stupot » Thu Apr 25, 2013 23:04

This has been discussed in the past. The package he attempted to install should have done it.

http://bugs.sabayon.org/show_bug.cgi?id=1049
http://bugs.sabayon.org/show_bug.cgi?id=2494
http://lists.sabayon.org/pipermail/deve ... 06794.html

https://packages.sabayon.org/show/pytho ... -show-what

lib-tk is there.

Please, what is the output of

Code: Select all
equo search python-tk
Stupot
Sagely Hen
 
Posts: 1511
Joined: Wed Feb 14, 2007 3:44
Location: St. Louis, MO, USA

Re: python-tk not installs correctly

Postby dkuku » Thu Apr 25, 2013 23:16

Code: Select all
  LC_ALL=en_US.UTF-8 /usr/bin/equo search python-tk
Trying to force en_US.UTF-8.
>>  @@ Searching...
>>      @@ Package: dev-lang/python-tk-2.7.3-r3 branch: 5, [sabayonlinux.org]
>>         Available:     version: 2.7.3-r3 ~ tag: NoTag ~ revision: 0
>>         Installed:     version: 2.7.3-r3 ~ tag: NoTag ~ revision: 0
>>         Slot:          2.7
>>         Homepage:      http://www.python.org/
>>         Description:   Tk libraries for Python (also provides
>>                        IDLE)
>>         License:       PSF-2
>>      @@ Package: dev-lang/python-tk-2.7.3-r3 branch: 5, [sabayon-weekly]
>>         Available:     version: 2.7.3-r3 ~ tag: NoTag ~ revision: 0
>>         Installed:     version: 2.7.3-r3 ~ tag: NoTag ~ revision: 0
>>         Slot:          2.7
>>         Homepage:      http://www.python.org/
>>         Description:   Tk libraries for Python (also provides
>>                        IDLE)
>>         License:       PSF-2
>>      @@ Package: dev-lang/python-tk-3.2.3-r2 branch: 5, [sabayon-weekly]
>>         Available:     version: 3.2.3-r2 ~ tag: NoTag ~ revision: 0
>>         Installed:     version: Not installed ~ tag: N/A ~ revision: N/A
>>         Slot:          3.2
>>         Homepage:      http://www.python.org/
>>         Description:   Tk libraries for Python (also provides
>>                        IDLE)
>>         License:       PSF-2
>>      @@ Package: dev-lang/python-tk-3.2.3-r2 branch: 5, [sabayonlinux.org]
>>         Available:     version: 3.2.3-r2 ~ tag: NoTag ~ revision: 0
>>         Installed:     version: Not installed ~ tag: N/A ~ revision: N/A
>>         Slot:          3.2
>>         Homepage:      http://www.python.org/
>>         Description:   Tk libraries for Python (also provides
>>                        IDLE)
>>         License:       PSF-2
>>      @@ Package: dev-lang/python-tk-3.3.0-r1 branch: 5, [sabayonlinux.org]
>>         Available:     version: 3.3.0-r1 ~ tag: NoTag ~ revision: 0
>>         Installed:     version: 3.3.0-r1 ~ tag: NoTag ~ revision: 0
>>         Slot:          3.3
>>         Homepage:      http://www.python.org/
>>         Description:   Tk libraries for Python (also provides
>>                        IDLE)
>>         License:       PSF-2
>>      @@ Package: dev-lang/python-tk-3.3.0-r1 branch: 5, [sabayon-weekly]
>>         Available:     version: 3.3.0-r1 ~ tag: NoTag ~ revision: 0
>>         Installed:     version: 3.3.0-r1 ~ tag: NoTag ~ revision: 0
>>         Slot:          3.3
>>         Homepage:      http://www.python.org/
>>         Description:   Tk libraries for Python (also provides
>>                        IDLE)
>>         License:       PSF-2
>>  Keywords:  python-tk
>>  Found:     6 entries

dkuku
Baby Hen
 
Posts: 9
Joined: Fri May 12, 2006 7:53

Re: python-tk not installs correctly

Postby dkuku » Thu Apr 25, 2013 23:30

Stupot wrote:This has been discussed in the past.
...
lib-tk is there.

It is not a problem for me to use portage version in one slot but many programming books use tcl/tk for gui programming (because it should always be installed with python) and when it isn't, then it could be painfull for someone who's new to python or sabayon. Same with IDLE, I couldn't find it by simply searching equo, I found it accidentally when I installed python-tk.
Maybe we should provide two versions of python - one for desktop and one for headless systems (python-minimal?)?
dkuku
Baby Hen
 
Posts: 9
Joined: Fri May 12, 2006 7:53

Re: python-tk not installs correctly

Postby Stupot » Fri Apr 26, 2013 15:29

There shouldn't be any need for that when we can just as easily keep the packages split up in the manner we have them now. I suppose the naming convention isn't the most intuitive, I'll give you that. I'm not really sure what other name would be more appropriate. I wonder if some tags should be added to the package so searching for IDLE shows python-tk. Should be easily enough.

But, it certainly looks as though you do have the correct packages installed. Unfortunately I'm at work at the moment. I'll try and take a look at this when I get home tonight. Seems like there might be something wrong with the python-tk package(s).
Stupot
Sagely Hen
 
Posts: 1511
Joined: Wed Feb 14, 2007 3:44
Location: St. Louis, MO, USA

Next

Return to Software in General

Who is online

Users browsing this forum: No registered users and 1 guest