You are not logged in.
Pages: 1
Topic closed
Hi,
I am learning Python on my own using Prof. Zelle's textbook Python Programming: An Introduction to Computer Science. I'm on Chapter 5 Objects and Graphics and I cannot import the graphics.py that is used by the book.
To make learning easier, I have written a graphics library (graphics.py) for use with this book. This library is freely available as a Python module file and you are welcome to use it as you see fit. Using the library is as easy as placing a copy of the graphics.py file in the same folder as your graphics program(s). Alternatively, you can put graphics.py in the system directory where other Python libraries are stored so that it can be used from any folder on the system.
But I get this error when I do:
[loafers@arch temp]$ python
Python 2.6.4 (r264:75706, Oct 27 2009, 06:16:59)
[GCC 4.4.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import graphics
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "graphics.py", line 149, in <module>
import Tkinter as tk
File "/usr/lib/python2.6/lib-tk/Tkinter.py", line 39, in <module>
import _tkinter # If this fails your Python may not be configured for Tk
ImportError: libtk8.5.so: cannot open shared object file: No such file or directory
>>>
Looking at the error, I'm guessing my Python may not be configured for Tk and I don't have libtk? I'm new and very confused and can't do anything in this chapter without this graphics.py Any help would be appreciated.
Regards,
Loafers
Last edited by Loafers (2009-11-24 01:24:13)
Offline
You probably just need to install tk: 'pacman -S tk'.
Offline
You probably just need to install tk: 'pacman -S tk'.
Thanks! I figured something like that and tried python-tk, tkinter, etc
Offline
Thanks for marking this thread as solved, but could you please include the original subject, e.g. "[SOLVED]Tkinter won't load". The title "[solved]" is not descriptive and doesn't help others who are searching for this.
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
Thanks to both Loafers and Xyne.
Offline
The thread is marked SOLVED without a clear answer. I got the same problem and the answer is as Speek pointed:
sudo pacman -S tk
Offline
necrobumping is bad form, necrobumping just to repeat the given answer is very bad form.
Offline
Closing, for the reasons listed by Scimmia.
Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline
Pages: 1
Topic closed