View previous topic :: View next topic |
Author |
Message |
3PO Veteran
Joined: 26 Nov 2006 Posts: 1110 Location: Schwabenländle
|
Posted: Sun Apr 22, 2012 7:23 am Post subject: python und Tkinter? |
|
|
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:
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 |
|
|
franzf Advocate
Joined: 29 Mar 2005 Posts: 4565
|
Posted: Sun Apr 22, 2012 7:34 am Post subject: Re: python und Tkinter? |
|
|
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?
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
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 |
|
|
3PO Veteran
Joined: 26 Nov 2006 Posts: 1110 Location: Schwabenländle
|
Posted: Sun Apr 22, 2012 7:40 am Post subject: |
|
|
Hier mal das Script auf einer Pastebin:
http://pastebin.de/25550
Verwendet wird python2.7. |
|
Back to top |
|
|
franzf Advocate
Joined: 29 Mar 2005 Posts: 4565
|
Posted: Sun Apr 22, 2012 7:53 am Post subject: |
|
|
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 |
|
|
3PO Veteran
Joined: 26 Nov 2006 Posts: 1110 Location: Schwabenländle
|
Posted: Sun Apr 22, 2012 8:01 am Post subject: |
|
|
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 |
|
|
franzf Advocate
Joined: 29 Mar 2005 Posts: 4565
|
Posted: Sun Apr 22, 2012 8:09 am Post subject: |
|
|
Und jetzt sag noch, welche Python-Version installiert wurde mit dem
dann bist du am Ziel... (was ich eigentlich schon in meiner ersten Antwort gesagt hatte). |
|
Back to top |
|
|
3PO Veteran
Joined: 26 Nov 2006 Posts: 1110 Location: Schwabenländle
|
Posted: Sun Apr 22, 2012 8:20 am Post subject: |
|
|
franzf wrote: | Und jetzt sag noch, welche Python-Version installiert wurde mit dem
|
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 |
|
|
Josef.95 Advocate
Joined: 03 Sep 2007 Posts: 4542 Location: Germany
|
Posted: Sun Apr 22, 2012 10:54 am Post subject: |
|
|
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 startest sollte sich das vermisste "Tkinter" Modul fehlerfrei via laden lassen. |
|
Back to top |
|
|
Josef.95 Advocate
Joined: 03 Sep 2007 Posts: 4542 Location: Germany
|
Posted: Sun May 06, 2012 7:49 pm Post subject: |
|
|
Ist das wirklich nicht hinzubekommen?
Poste doch ansonsten mal die Ausgabe von Code: | emerge -pvq python:2.7 python |
|
|
Back to top |
|
|
Josef.95 Advocate
Joined: 03 Sep 2007 Posts: 4542 Location: Germany
|
Posted: Mon May 14, 2012 7:43 am Post subject: |
|
|
Hm, ist es wirtlich nicht hinzubekommen python:2.7 mit tk USE-Flag zu bauen? |
|
Back to top |
|
|
3PO Veteran
Joined: 26 Nov 2006 Posts: 1110 Location: Schwabenländle
|
Posted: Mon May 14, 2012 4:12 pm Post subject: |
|
|
Doch klar, hat sich somit erledigt.
THX |
|
Back to top |
|
|
|