Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
python und Tkinter?
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German) Diskussionsforum
View previous topic :: View next topic  
Author Message
3PO
Veteran
Veteran


Joined: 26 Nov 2006
Posts: 1110
Location: Schwabenländle

PostPosted: Sun Apr 22, 2012 7:23 am    Post subject: python und Tkinter? Reply with quote

Hallo Zusammen,

Ich habe von HIER ein kleines python Script, das wohl Tkinter benötigt.

Dann habe ich in der "make.conf" das Useflag "tk" gesetzt und python neu gebaut:
Code:
emerge -N python


Wenn nun versuche, das Script zu starten, nörgelt es, dass Tkinter fehlen würde:

Code:
vdr01 var # ./bwm.py
Traceback (most recent call last):
  File "./bwm.py", line 8, in <module>
    from Tkinter import *        # python-tk-2.7.2-7.1.3.i586 oder python-tk-2.7.2-7.5.1.x86_64
ImportError: No module named Tkinter
vdr01 var #


python-tk gibt es nicht im Portage, es gibt aber im zugania Overlay ein dev-lang/python-tk, muss das evtl. installiert werden?

Ich möchte mir halt mein python nicht ruinieren, das es ja von portage gebraucht wird. ;)

Hat Jemand eine Idee, wie ich das Problem mit Tkinter lösen kannn?
Back to top
View user's profile Send private message
franzf
Advocate
Advocate


Joined: 29 Mar 2005
Posts: 4565

PostPosted: Sun Apr 22, 2012 7:34 am    Post subject: Re: python und Tkinter? Reply with quote

3PO wrote:
Ich habe von HIER ein kleines python Script

Kriegt man nur als registrierter User.

Quote:
Dann habe ich in der "make.conf" das Useflag "tk" gesetzt und python neu gebaut:

Warum ein lokales USE-Flag nicht in der package.use setzen?

Code:
emerge -N python

welches python wurde da neu gebaut?

Code:
vdr01 var # ./bwm.py
Traceback (most recent call last):
  File "./bwm.py", line 8, in <module>
    from Tkinter import *        # python-tk-2.7.2-7.1.3.i586 oder python-tk-2.7.2-7.5.1.x86_64
ImportError: No module named Tkinter
vdr01 var #

Was steht am Anfang des Scripts?
Nur
Code:
#!/bin/env python

oder statt python ein "python2" oder "python2.7"?
Welches python ist dein Default?
Code:
eselect python list

Ist DIESE Version auch mit USE="tk" gebaut worden?
Fall eine spezifische python-Version im Script steht, wurde diese mit tk gebaut?
Bzw. bei "python2" die, die bei
Code:
eselect python list --python2

gelistet wird?
Back to top
View user's profile Send private message
3PO
Veteran
Veteran


Joined: 26 Nov 2006
Posts: 1110
Location: Schwabenländle

PostPosted: Sun Apr 22, 2012 7:40 am    Post subject: Reply with quote

Hier mal das Script auf einer Pastebin:

http://pastebin.de/25550

Verwendet wird python2.7.
Back to top
View user's profile Send private message
franzf
Advocate
Advocate


Joined: 29 Mar 2005
Posts: 4565

PostPosted: Sun Apr 22, 2012 7:53 am    Post subject: Reply with quote

3PO wrote:
Verwendet wird python2.7.

Wie kommst du darauf? Hast du das mit eselect pyhon geschaut, dass dein Default-Python ein 2.7er ist?
Oder weil bei denen python2.7 im Kommentar steht?
Denn das Script nimmt einfach nur das default-Python, und das muss nicht 2.7 sein!
Back to top
View user's profile Send private message
3PO
Veteran
Veteran


Joined: 26 Nov 2006
Posts: 1110
Location: Schwabenländle

PostPosted: Sun Apr 22, 2012 8:01 am    Post subject: Reply with quote

franzf wrote:
3PO wrote:
Verwendet wird python2.7.

Wie kommst du darauf? Hast du das mit eselect pyhon geschaut, dass dein Default-Python ein 2.7er ist? ...

Ja.

Code:
vdr01 var # eselect python list
Available Python interpreters:
  [1]   python2.7 *
  [2]   python3.1
  [3]   python3.2
vdr01 var #
Back to top
View user's profile Send private message
franzf
Advocate
Advocate


Joined: 29 Mar 2005
Posts: 4565

PostPosted: Sun Apr 22, 2012 8:09 am    Post subject: Reply with quote

Und jetzt sag noch, welche Python-Version installiert wurde mit dem
Code:
emerge -N python

dann bist du am Ziel... (was ich eigentlich schon in meiner ersten Antwort gesagt hatte).
Back to top
View user's profile Send private message
3PO
Veteran
Veteran


Joined: 26 Nov 2006
Posts: 1110
Location: Schwabenländle

PostPosted: Sun Apr 22, 2012 8:20 am    Post subject: Reply with quote

franzf wrote:
Und jetzt sag noch, welche Python-Version installiert wurde mit dem
Code:
emerge -N python


Vermutlich die falsche...^^

Code:
vdr01 ~ # eix dev-lang/python
[I] dev-lang/python
     Available versions:
        (2.5)   2.5.4-r4
        (2.6)   2.6.6-r2 ~2.6.7-r2
        (2.7)   2.7.2-r3 ~2.7.3
        (3.1)   3.1.4-r3 ~3.1.4-r4
        (3.2)   3.2.2 ~3.2.2-r1
        {{-berkdb build doc elibc_uclibc examples gdbm ipv6 +ncurses +readline sqlite +ssl +threads tk +wide-unicode wininst +xml}}
     Installed versions:  2.7.2-r3(2.7)(08:02:01 AM 11/17/2011)(gdbm ipv6 ncurses readline ssl threads wide-unicode xml -berkdb -build -doc -elibc_uclibc -examples -sqlite -tk -wininst) 3.1.4-r3(3.1)(08:20:54 AM 11/17/2011)(gdbm ipv6 ncurses readline ssl threads wide-unicode xml -build -doc -elibc_uclibc -examples -sqlite -tk -wininst) 3.2.2(3.2)(07:01:31 PM 04/21/2012)(gdbm ipv6 ncurses readline ssl threads tk wide-unicode xml -build -doc -elibc_uclibc -examples -sqlite -wininst)
     Homepage:            http://www.python.org/
     Description:         Python is an interpreted, interactive, object-oriented programming language.


Ich werde mal ein:
Code:
emerge -avN =dev-lang/python-2.7.2-r3
versuchen.

Oder sollte ich auf python 3.2.x updaten?
Back to top
View user's profile Send private message
Josef.95
Advocate
Advocate


Joined: 03 Sep 2007
Posts: 4509
Location: Germany

PostPosted: Sun Apr 22, 2012 10:54 am    Post subject: Reply with quote

Mache es doch am besten wie schon vorgeschlagen ;)
Code:
echo "dev-lang/python:2.7 tk" >> /etc/portage/package.use
emerge -av1N python:2.7


Wenn du dann
Code:
$ python
startest sollte sich das vermisste "Tkinter" Modul fehlerfrei via
Code:
import Tkinter
laden lassen.
Back to top
View user's profile Send private message
Josef.95
Advocate
Advocate


Joined: 03 Sep 2007
Posts: 4509
Location: Germany

PostPosted: Sun May 06, 2012 7:49 pm    Post subject: Reply with quote

Ist das wirklich nicht hinzubekommen?
Poste doch ansonsten mal die Ausgabe von
Code:
emerge -pvq python:2.7 python
Back to top
View user's profile Send private message
Josef.95
Advocate
Advocate


Joined: 03 Sep 2007
Posts: 4509
Location: Germany

PostPosted: Mon May 14, 2012 7:43 am    Post subject: Reply with quote

Hm, ist es wirtlich nicht hinzubekommen python:2.7 mit tk USE-Flag zu bauen?
Back to top
View user's profile Send private message
3PO
Veteran
Veteran


Joined: 26 Nov 2006
Posts: 1110
Location: Schwabenländle

PostPosted: Mon May 14, 2012 4:12 pm    Post subject: Reply with quote

Doch klar, hat sich somit erledigt.

THX :)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German) Diskussionsforum All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum