View previous topic :: View next topic |
Author |
Message |
VanFanel Apprentice
Joined: 19 Feb 2007 Posts: 161
|
Posted: Thu Jun 23, 2011 1:00 pm Post subject: getting TKinter error on phyton app: tk USE flag set |
|
|
Hello there
I'm trying to run a python app, with needs TKinter to create a gui, apparently.
The problem is that I have set the "tk" flag and re-emerged python. In fact, I have /usr/lib/python3.1/lib-dynload/_tkinter.so in my system, but I still get
Code: |
ImportError: No module named TKinter
|
when trying to run an app.
I also ran python-updater after re-emerge, and even tried to run the *.py program with phyton3.1directly intead of the default one. Always the same error.
regards |
|
Back to top |
|
|
rh1 Guru
Joined: 10 Apr 2010 Posts: 501
|
Posted: Thu Jun 23, 2011 2:12 pm Post subject: |
|
|
I belive the module is now named 'tkinter' in Python 3. |
|
Back to top |
|
|
solamour l33t
Joined: 21 Dec 2004 Posts: 698 Location: San Diego, CA
|
Posted: Fri Jul 27, 2012 3:58 am Post subject: |
|
|
I know it's an old thread, so I hope everyone has already figured it out by now. If you haven't, here is something that worked for me.
Code: | /etc/portage/package.use
dev-lang/python tk |
Code: | emerge -v --newuse python |
Now, "import tkinter" (for Python 3.x) should work, but if it gives you "ImportError: No module named tkinter", make sure you are using the right Python version. For my case, I had v2.7, v3.1 (as default), and v3.2.
Code: | $ eselect python list
Available Python interpreters:
[1] python2.7
[2] python3.1 *
[3] python3.2
|
"tk" use flag was applied to v3.2 only, so when I ran python v3.1, it didn't know anything about tk use flag. I set the default Python to v3.2, and the problem went away.
__
sol |
|
Back to top |
|
|
|
|
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
|
|