how to install SIP for python on MAC

360 views
Skip to first unread message

unread,
Oct 4, 2011, 9:43:32 AM10/4/11
to python_inside_maya
hi, i got a problem when i was installing PyQt4 on mac, first i
installed sip-4.12.5 for python, but i got an error when i import the
sip module.

>>> import sip
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.6/
lib/python2.6/site-packages/sip.so, 2): no suitable image found. Did
find:
/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-
packages/sip.so: mach-o, but wrong architecture
i reinstalled the sip many times, and does anybody can help me?

unread,
Oct 4, 2011, 10:11:12 AM10/4/11
to python_inside_maya
forget to post my tools
i use
Mac OS X (Snow Leopard)
python-2.6.4
sip-4.12.5
PyQt-mac-gpl-4.8.5

Justin Israel

unread,
Oct 4, 2011, 1:57:20 PM10/4/11
to python_in...@googlegroups.com
Most likely what happened is that you sip and qt are not built with
the same arch.
Can you reply with the results of this?
lipo -info /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/sip.so

Most likely what you want to do is rebuilt sip, but use these flags:
python configure.py --arch="386" --arch="x86_64"

That way it will built 32 and 64bit. Then reinstall pyqt.

-- justin

2011/10/4 宇 <1988...@gmail.com>:

> --
> view archives: http://groups.google.com/group/python_inside_maya
> change your subscription settings: http://groups.google.com/group/python_inside_maya/subscribe
>

ZhangYu

unread,
Oct 6, 2011, 11:31:37 AM10/6/11
to python_in...@googlegroups.com
I got the result is Non-fat file: /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/sip.so is architecture: x86_64

If i should rebuilt sip, witch flag should i use? Both with --arch="386" --arch="x86_64" ? My system is 64bits

ZhangYu

unread,
Oct 6, 2011, 12:06:56 PM10/6/11
to python_in...@googlegroups.com
With the code you post, it works! i can import sip, but when i rebuilt the pyqt, a new problem appeared, there is the error callback
Zhang-Yus-MacBook-Pro:PyQt-mac-gpl-4.8.5 zhangyu$ python configure.py
Determining the layout of your Qt installation...
Error: Failed to determine the layout of your Qt installation. Try again using
the --verbose flag to see more detail about the problem.
I reinstalled the qt but it doesn't work!
please help

在 Oct 5, 2011,1:57 AM, Justin Israel 写道:

Justin Israel

unread,
Oct 6, 2011, 12:45:16 PM10/6/11
to python_in...@googlegroups.com
Since this is a maya mailing list, I'm assuming you are installing
PyQt for use in maya?
I have a blog about it, if this helps at all:
http://www.justinfx.com/2011/01/07/installing-pyqt-for-maya-2011-osx/

Maybe you could run > python configure.py --verbose and see more info?

Also, what qt did you install? Was it from the binary installer or did
you build from source?

Vordok

unread,
Oct 6, 2011, 6:34:12 PM10/6/11
to python_inside_maya
Why dont you try using the mac ports version?

On Oct 6, 11:45 am, Justin Israel <justinisr...@gmail.com> wrote:
> Since this is a maya mailing list, I'm assuming you are installing
> PyQt for use in maya?
> I have a blog about it, if this helps at all:http://www.justinfx.com/2011/01/07/installing-pyqt-for-maya-2011-osx/
>
> Maybe you could run   > python configure.py --verbose and see more info?
>
> Also, what qt did you install? Was it from the binary installer or did
> you build from source?
>
>
>
>
>
>
>
> On Thu, Oct 6, 2011 at 9:06 AM, ZhangYu <1988he...@gmail.com> wrote:
> > With the code you post, it works! i can import sip, but when i rebuilt the pyqt, a new problem appeared, there is the error callback
> > Zhang-Yus-MacBook-Pro:PyQt-mac-gpl-4.8.5 zhangyu$ python configure.py
> > Determining the layout of your Qt installation...
> > Error: Failed to determine the layout of your Qt installation. Try again using
> > the --verbose flag to see more detail about the problem.
> > I reinstalled the qt but it doesn't work!
> > please help
> > 在 Oct 5, 2011,1:57 AM, Justin Israel 写道:
>
> >> Most likely what happened is that you sip and qt are not built with
> >> the same arch.
> >> Can you reply with the results of this?
> >> lipo -info /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/sip.so
>
> >> Most likely what you want to do is rebuilt sip, but use these flags:
> >> python configure.py --arch="386" --arch="x86_64"
>
> >> That way it will built 32 and 64bit. Then reinstall pyqt.
>
> >> -- justin
>
> >> 2011/10/4 宇 <1988he...@gmail.com>:

Justin Israel

unread,
Oct 6, 2011, 9:19:37 PM10/6/11
to python_in...@googlegroups.com

That would work if he only wanted to get pyqt independently running as a whole. But assuming he wants to use pyqt inside maya (otherwise it wouldnt make sense to ask here), you have to use specific versions and build steps for it to link properly and work. My blog was written for maya 2011. For 2012 there are some updated version numbers for qt, sip, pyqt. I should update my blog with that info.

ZhangYu

unread,
Oct 7, 2011, 12:42:55 AM10/7/11
to python_in...@googlegroups.com
I download the qt file is qt-mac-cocoa-opensource-4.6.4.dmg, not the source file
At first i want to install PyQt outside maya, the next step i want to use in maya.

张宇

unread,
Oct 7, 2011, 10:03:41 AM10/7/11
to python_in...@googlegroups.com
Thanks for your tutorial, I made it in maya,and i thought outside Maya there was a wrong version of python I installed, thanks
Reply all
Reply to author
Forward
0 new messages