I am trying to run the following command on a Mac 10.6.8:
Python 2.7.2 |EPD 7.1-2 (64-bit)| (default, Jul 27 2011, 14:50:45)
[GCC 4.0.1 (Apple Inc. build 5493)] on darwin
import Image
import ImageTk
from Tkinter import Tk
window = Tk()
i = Image.open("file.jpg")
photo = ImageTk.PhotoImage(i)
Segmentation fault
I've seen others have had a bus error in this situation. Does anyone know of a bug here or a way round it? I couldn't understand whether http://infohost.nmt.edu/tcc/help/pubs/pil/image-tk.html was relevant. Thanks!
I'm sorry to say the same thing happens even after upgrading EPD:
Python 2.7.2 |EPD 7.2-2 (64-bit)| (default, Sep 7 2011, 16:31:15)
[GCC 4.0.1 (Apple Inc. build 5493)] on darwin
If you are not using Apple's Tcl/Tk
, try running otool -L
on _imagingtk.so
to see whether it is looking for its shared libraries in /System/Library
. It should be looking in /Library
, not /System/Library
. If so, you can change the library search path with install_name_tool
.
Have you tried running Mac Python in 32 bit mode?
Look at the Fat Binary:
cd /usr/bin/
file python
I get:
python: Mach-O universal binary with 2 architectures
python (for architecture x86_64): Mach-O 64-bit executable x86_64
python (for architecture i386): Mach-O executable i386
To try 32 bit mode you would do:
arch -i386 /usr/bin/python
If that works, then it would at least be a workaround.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With