<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Installation of PyQt on Mac OS X</title>
	<atom:link href="http://www.oak-tree.us/blog/index.php/2009/05/12/pyqt-mac/feed" rel="self" type="application/rss+xml" />
	<link>http://www.oak-tree.us/blog/index.php/2009/05/12/pyqt-mac</link>
	<description>The Rants and Raves of an Unsettled Mind</description>
	<lastBuildDate>Wed, 07 Apr 2010 15:43:23 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Tore Torset</title>
		<link>http://www.oak-tree.us/blog/index.php/2009/05/12/pyqt-mac/comment-page-1#comment-11087</link>
		<dc:creator>Tore Torset</dc:creator>
		<pubDate>Tue, 16 Mar 2010 16:20:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.oak-tree.us/blog/?p=896#comment-11087</guid>
		<description>Hi, thanks for the guide!

I do however have some problems making it work on Snow Leopard (10.6.2). I&#039;m quite new to a lot of this, so I hope someone can help me out

I&#039;m using:
Python 2.6.4
Sip-4.10
PyQt-mac-gpl-4.7
qt-mac-cocoa-opensource-4.6.2

Other QT verions did not work (error: Failed to determine the layout of your Qt installation when trying to configure PyQt)

Now however, I am stuck on a different error. When trying to configure PyQt i get the following error: 
Error: Unable to create the C++ code.

Ive tried to rebuild sip using -arch i386 as well, but I&#039;m not sure if it is sip causing this...
Can it be a problem of the Qt install?

I&#039;ve tried configuring PyQt using –verbose -j 1 –no-designer-plugin -q as proposed above by mark, or as propsed by original poster and also --use-arch i386. All return the same error of not being able to create the c++ code

Could compiling the Qt installation work? 
When browsing ftp://ftp.qt.nokia.com/qt/source/ for source versions, I could&#039;nt find the mac version src for 4.6.x... Perhaps someone could point me to the correct source to use for 4.6.x and higher?

Any hints and tips is appreciated!
Will</description>
		<content:encoded><![CDATA[<p>Hi, thanks for the guide!</p>
<p>I do however have some problems making it work on Snow Leopard (10.6.2). I'm quite new to a lot of this, so I hope someone can help me out</p>
<p>I'm using:<br />
Python 2.6.4<br />
Sip-4.10<br />
PyQt-mac-gpl-4.7<br />
qt-mac-cocoa-opensource-4.6.2</p>
<p>Other QT verions did not work (error: Failed to determine the layout of your Qt installation when trying to configure PyQt)</p>
<p>Now however, I am stuck on a different error. When trying to configure PyQt i get the following error:<br />
Error: Unable to create the C++ code.</p>
<p>Ive tried to rebuild sip using -arch i386 as well, but I'm not sure if it is sip causing this...<br />
Can it be a problem of the Qt install?</p>
<p>I've tried configuring PyQt using –verbose -j 1 –no-designer-plugin -q as proposed above by mark, or as propsed by original poster and also --use-arch i386. All return the same error of not being able to create the c++ code</p>
<p>Could compiling the Qt installation work?<br />
When browsing <a href="ftp://ftp.qt.nokia.com/qt/source/" rel="nofollow">ftp://ftp.qt.nokia.com/qt/source/</a> for source versions, I could'nt find the mac version src for 4.6.x... Perhaps someone could point me to the correct source to use for 4.6.x and higher?</p>
<p>Any hints and tips is appreciated!<br />
Will</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve Steiner</title>
		<link>http://www.oak-tree.us/blog/index.php/2009/05/12/pyqt-mac/comment-page-1#comment-9186</link>
		<dc:creator>Steve Steiner</dc:creator>
		<pubDate>Thu, 14 Jan 2010 17:00:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.oak-tree.us/blog/?p=896#comment-9186</guid>
		<description># python configure.py --arch=i386 -d /Library/Python/2.6/site-packages

And sip imports fine.  NOTE: I&#039;m running Python 2.6.4 installed from the python.org .dmg file install, which it turns out is 32 bit so it seems that the auto-detect of x86_64 is wrong and I may have to rebuild *everything*.</description>
		<content:encoded><![CDATA[<p># python configure.py --arch=i386 -d /Library/Python/2.6/site-packages</p>
<p>And sip imports fine.  NOTE: I'm running Python 2.6.4 installed from the python.org .dmg file install, which it turns out is 32 bit so it seems that the auto-detect of x86_64 is wrong and I may have to rebuild *everything*.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve Steiner</title>
		<link>http://www.oak-tree.us/blog/index.php/2009/05/12/pyqt-mac/comment-page-1#comment-9180</link>
		<dc:creator>Steve Steiner</dc:creator>
		<pubDate>Thu, 14 Jan 2010 15:26:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.oak-tree.us/blog/?p=896#comment-9180</guid>
		<description>I had to modify the PyQT build line to:

# python configure.py -w -q /usr/local/Trolltech/Qt-4.6.1/bin/qmake

Not sure which part  of the original command was causing a problem.  Now I get an error on sip.so being the wrong arch.

 python examples/demos/qtdemo/qtdemo.py 
Traceback (most recent call last):
  File &quot;examples/demos/qtdemo/qtdemo.py&quot;, line 46, in 
    import sip
ImportError: dlopen(/Users/ssteiner/.virtualenvs/py-2.6.4-1/lib/python2.6/site-packages/sip.so, 2): no suitable image found.  Did find:
        /Users/ssteiner/.virtualenvs/py-2.6.4-1/lib/python2.6/site-packages/sip.so: mach-o, but wrong architecture

I&#039;m a couple of versions up on everything (QT 4.6.1, sip-4.9.3,  PyQt-mac-gpl-4.6.2)

Will come back with a solution if I find one.</description>
		<content:encoded><![CDATA[<p>I had to modify the PyQT build line to:</p>
<p># python configure.py -w -q /usr/local/Trolltech/Qt-4.6.1/bin/qmake</p>
<p>Not sure which part  of the original command was causing a problem.  Now I get an error on sip.so being the wrong arch.</p>
<p> python examples/demos/qtdemo/qtdemo.py<br />
Traceback (most recent call last):<br />
  File "examples/demos/qtdemo/qtdemo.py", line 46, in<br />
    import sip<br />
ImportError: dlopen(/Users/ssteiner/.virtualenvs/py-2.6.4-1/lib/python2.6/site-packages/sip.so, 2): no suitable image found.  Did find:<br />
        /Users/ssteiner/.virtualenvs/py-2.6.4-1/lib/python2.6/site-packages/sip.so: mach-o, but wrong architecture</p>
<p>I'm a couple of versions up on everything (QT 4.6.1, sip-4.9.3,  PyQt-mac-gpl-4.6.2)</p>
<p>Will come back with a solution if I find one.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sanchox</title>
		<link>http://www.oak-tree.us/blog/index.php/2009/05/12/pyqt-mac/comment-page-1#comment-8550</link>
		<dc:creator>sanchox</dc:creator>
		<pubDate>Mon, 28 Dec 2009 21:48:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.oak-tree.us/blog/?p=896#comment-8550</guid>
		<description>hello there, thanks for the detailed writeup...

I am having an issue completing the installation process :(  i am on a g5 running 10.5.8.  I have followed everything to a T but when i run this command:   python configure.py -q /usr/bin/qmake-4.6 -d /Library/Python/2.6/site-packages/

i get this:  Determining the layout of your Qt installation...
Error: qtdirs.app/Contents/MacOS/qtdirs failed to create qtdirs.out. Make sure
your Qt v4 installation is correct.

i did a quick search and found the app qtdirs and noticed that it is not compiled for the ppc architecture...  i imagine this is the root of the problem, and after a few minutes of googling, i have found nothing that helps.  any chance you have a solution?  

thanks for your time!</description>
		<content:encoded><![CDATA[<p>hello there, thanks for the detailed writeup...</p>
<p>I am having an issue completing the installation process <img src='http://www.oak-tree.us/blog/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />   i am on a g5 running 10.5.8.  I have followed everything to a T but when i run this command:   python configure.py -q /usr/bin/qmake-4.6 -d /Library/Python/2.6/site-packages/</p>
<p>i get this:  Determining the layout of your Qt installation...<br />
Error: qtdirs.app/Contents/MacOS/qtdirs failed to create qtdirs.out. Make sure<br />
your Qt v4 installation is correct.</p>
<p>i did a quick search and found the app qtdirs and noticed that it is not compiled for the ppc architecture...  i imagine this is the root of the problem, and after a few minutes of googling, i have found nothing that helps.  any chance you have a solution?  </p>
<p>thanks for your time!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark Fickett - PyQt4 Installation on Snow Leopard</title>
		<link>http://www.oak-tree.us/blog/index.php/2009/05/12/pyqt-mac/comment-page-1#comment-4805</link>
		<dc:creator>Mark Fickett - PyQt4 Installation on Snow Leopard</dc:creator>
		<pubDate>Thu, 17 Sep 2009 06:05:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.oak-tree.us/blog/?p=896#comment-4805</guid>
		<description>I found that the out-of-the-box installation does not work on MacOS X Snow Leopard. Here&#039;s what I did that eventually did get it to work.

(My default python is 2.6. Note that during installation for Qt and PyQt4, there were lots of warnings that &#039;Support for this version of Mac OS X is still preliminary&#039;.)

I. What worked

tar xvfz qt-mac-opensource-src-4.5.2.tar.gz
cd qt-mac-opensource-src-4.5.2
./configure -arch x86_64 -opensource
make
sudo make install

At this point, you can run the Qt demo - a necessary, but not sufficient condition for PyQt4.
$ open /usr/local/Trolltech/Qt-4.5.2/bin/qtdemo.app

SIP is a prerequisite for PyQt:
tar xvfz sip-4.9-snapshot-20090906.tar.gz
cd sip-4.9-snapshot-20090906
python configure.py
make
sudo make install

tar xvfz PyQt-mac-gpl-4.6-snapshot-20090906.tar.gz
cd PyQt-mac-gpl-4.6-snapshot-20090906
python configure.py --verbose -j 1 --no-designer-plugin -q /usr/local/Trolltech/Qt-4.5.2/bin/qmake
make
sudo make install

And now you can run the PyQt version of the demo application:
$ python examples/demos/qtdemo/qtdemo.py

II. System details

Mac OS X, Version 10.6.1
MacBook Pro, Intel Core 2 Duo
Python 2.6.1 (from Apple)
Compilation tools from XCode install:
$ g++ --version
i686-apple-darwin10-g++-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5646)

III. Various things that didn&#039;t work

The package installer from Qt for Mac OS X didn&#039;t work (it sat for a while preparing, and then failed; the console had a message about not being able to communicate with a daemon).

After installing Qt with the default ./configure, PyQt configuration doesn&#039;t succeed for anything except QtCore, and importing QtCore doesn&#039;t work. After installing Qt 4.5.2 as I installed 4.6, PyQt configuration succeeds, but there are compilation errors.</description>
		<content:encoded><![CDATA[<p>I found that the out-of-the-box installation does not work on MacOS X Snow Leopard. Here's what I did that eventually did get it to work.</p>
<p>(My default python is 2.6. Note that during installation for Qt and PyQt4, there were lots of warnings that 'Support for this version of Mac OS X is still preliminary'.)</p>
<p>I. What worked</p>
<p>tar xvfz qt-mac-opensource-src-4.5.2.tar.gz<br />
cd qt-mac-opensource-src-4.5.2<br />
./configure -arch x86_64 -opensource<br />
make<br />
sudo make install</p>
<p>At this point, you can run the Qt demo - a necessary, but not sufficient condition for PyQt4.<br />
$ open /usr/local/Trolltech/Qt-4.5.2/bin/qtdemo.app</p>
<p>SIP is a prerequisite for PyQt:<br />
tar xvfz sip-4.9-snapshot-20090906.tar.gz<br />
cd sip-4.9-snapshot-20090906<br />
python configure.py<br />
make<br />
sudo make install</p>
<p>tar xvfz PyQt-mac-gpl-4.6-snapshot-20090906.tar.gz<br />
cd PyQt-mac-gpl-4.6-snapshot-20090906<br />
python configure.py --verbose -j 1 --no-designer-plugin -q /usr/local/Trolltech/Qt-4.5.2/bin/qmake<br />
make<br />
sudo make install</p>
<p>And now you can run the PyQt version of the demo application:<br />
$ python examples/demos/qtdemo/qtdemo.py</p>
<p>II. System details</p>
<p>Mac OS X, Version 10.6.1<br />
MacBook Pro, Intel Core 2 Duo<br />
Python 2.6.1 (from Apple)<br />
Compilation tools from XCode install:<br />
$ g++ --version<br />
i686-apple-darwin10-g++-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5646)</p>
<p>III. Various things that didn't work</p>
<p>The package installer from Qt for Mac OS X didn't work (it sat for a while preparing, and then failed; the console had a message about not being able to communicate with a daemon).</p>
<p>After installing Qt with the default ./configure, PyQt configuration doesn't succeed for anything except QtCore, and importing QtCore doesn't work. After installing Qt 4.5.2 as I installed 4.6, PyQt configuration succeeds, but there are compilation errors.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Moses Ting</title>
		<link>http://www.oak-tree.us/blog/index.php/2009/05/12/pyqt-mac/comment-page-1#comment-3232</link>
		<dc:creator>Moses Ting</dc:creator>
		<pubDate>Sun, 12 Jul 2009 22:22:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.oak-tree.us/blog/?p=896#comment-3232</guid>
		<description>Thanks for the wonderful instructions.  In the process of installing on Mac OS X Leopard!</description>
		<content:encoded><![CDATA[<p>Thanks for the wonderful instructions.  In the process of installing on Mac OS X Leopard!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Apolitically Incorrect &#187; Why Bother With a Personal Website?</title>
		<link>http://www.oak-tree.us/blog/index.php/2009/05/12/pyqt-mac/comment-page-1#comment-3117</link>
		<dc:creator>Apolitically Incorrect &#187; Why Bother With a Personal Website?</dc:creator>
		<pubDate>Fri, 10 Jul 2009 20:16:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.oak-tree.us/blog/?p=896#comment-3117</guid>
		<description>[...] where should you leave notes on how to set-up and configure your home server, the instructions for installing PyQt on Mac OS X for the first time, or the essential (though obscure) Subversion commands that you infrequently [...]</description>
		<content:encoded><![CDATA[<p>[...] where should you leave notes on how to set-up and configure your home server, the instructions for installing PyQt on Mac OS X for the first time, or the essential (though obscure) Subversion commands that you infrequently [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scott</title>
		<link>http://www.oak-tree.us/blog/index.php/2009/05/12/pyqt-mac/comment-page-1#comment-2634</link>
		<dc:creator>Scott</dc:creator>
		<pubDate>Sat, 20 Jun 2009 22:56:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.oak-tree.us/blog/?p=896#comment-2634</guid>
		<description>Woohoo! I finally got it.  Turns out PyQ4 4.5 was buggy, so I compiled the latest version, 4.5.1, which was released on June 16th.  It worked on the first try.  Sometimes it just pays to wait for the next version.</description>
		<content:encoded><![CDATA[<p>Woohoo! I finally got it.  Turns out PyQ4 4.5 was buggy, so I compiled the latest version, 4.5.1, which was released on June 16th.  It worked on the first try.  Sometimes it just pays to wait for the next version.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scott</title>
		<link>http://www.oak-tree.us/blog/index.php/2009/05/12/pyqt-mac/comment-page-1#comment-2587</link>
		<dc:creator>Scott</dc:creator>
		<pubDate>Thu, 18 Jun 2009 20:51:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.oak-tree.us/blog/?p=896#comment-2587</guid>
		<description>Thanks for the tips Rob, but I&#039;m really just at a wall.  I think my problem is that I Installed MacPython 3.0 and even after removing it and redoing everything, including compiling 2.63 and compiling PyQt into that it still won&#039;t work.  I&#039;ve tested some Qt demo apps with XCode and they worked perfectly, so it doesn&#039;t appear to be a problem with my Qt installation.  It&#039;s something to do with the way I compiled sip and PyQt.  I&#039;ll post if I find a solution, but I&#039;m still open to suggestions.  Thank you!</description>
		<content:encoded><![CDATA[<p>Thanks for the tips Rob, but I'm really just at a wall.  I think my problem is that I Installed MacPython 3.0 and even after removing it and redoing everything, including compiling 2.63 and compiling PyQt into that it still won't work.  I've tested some Qt demo apps with XCode and they worked perfectly, so it doesn't appear to be a problem with my Qt installation.  It's something to do with the way I compiled sip and PyQt.  I'll post if I find a solution, but I'm still open to suggestions.  Thank you!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rob Oakes</title>
		<link>http://www.oak-tree.us/blog/index.php/2009/05/12/pyqt-mac/comment-page-1#comment-2532</link>
		<dc:creator>Rob Oakes</dc:creator>
		<pubDate>Tue, 16 Jun 2009 18:55:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.oak-tree.us/blog/?p=896#comment-2532</guid>
		<description>@Scott.  Thanks for the feedback, I&#039;m glad that you found the tutorial to be useful.  After reading through your experience, I had a few thoughts about where the problem may lie: 

1) It may not be an issue with your python installation, but rather with your Qt installation.  I&#039;ve been trying to compile Qt on Cygwin and while it will build and install, it doesn&#039;t work correctly.  Thus, when I try and build PyQt against it, the build process fails.  One way to validate your Qt installation would be to try and compile a few of the demo programs.  These can be found in the documentation folder.  If you installed using the Qt 2009.02 SDK, you&#039;ll find it under /Developer/Examples/Qt.

2) If you have other versions of Qt installed, make sure that pyqt found the correct version of qmake.  Though I don&#039;t know what it does, Leopard appears to have a version of qmake that is either bundled with the system or comes with XCode.  This version of qmake doesn&#039;t appear to build against the appropriate frameworks.  When configuring pyqt, make sure to use the -q flag and reference /usr/bin/qmake-4.5 rather than /usr/bin/qmake.  It makes an important difference.  Example:

python configure.py -q /usr/bin/qmake-4.5 -d /Library/Python/2.5/site-packages/

One last thought, if you have more than one version of python installed (say from MacPorts or MacPython), make sure that the correct version of python is being referenced.  The instructions I give above are for the native install of Python.  (But it sounds like you&#039;ve already checked this via sys.path.)  I&#039;ve never liked using MacPorts/MacPython, since they tend to wreak havoc with my system.

Best of luck,

Rob</description>
		<content:encoded><![CDATA[<p>@Scott.  Thanks for the feedback, I'm glad that you found the tutorial to be useful.  After reading through your experience, I had a few thoughts about where the problem may lie: </p>
<p>1) It may not be an issue with your python installation, but rather with your Qt installation.  I've been trying to compile Qt on Cygwin and while it will build and install, it doesn't work correctly.  Thus, when I try and build PyQt against it, the build process fails.  One way to validate your Qt installation would be to try and compile a few of the demo programs.  These can be found in the documentation folder.  If you installed using the Qt 2009.02 SDK, you'll find it under /Developer/Examples/Qt.</p>
<p>2) If you have other versions of Qt installed, make sure that pyqt found the correct version of qmake.  Though I don't know what it does, Leopard appears to have a version of qmake that is either bundled with the system or comes with XCode.  This version of qmake doesn't appear to build against the appropriate frameworks.  When configuring pyqt, make sure to use the -q flag and reference /usr/bin/qmake-4.5 rather than /usr/bin/qmake.  It makes an important difference.  Example:</p>
<p>python configure.py -q /usr/bin/qmake-4.5 -d /Library/Python/2.5/site-packages/</p>
<p>One last thought, if you have more than one version of python installed (say from MacPorts or MacPython), make sure that the correct version of python is being referenced.  The instructions I give above are for the native install of Python.  (But it sounds like you've already checked this via sys.path.)  I've never liked using MacPorts/MacPython, since they tend to wreak havoc with my system.</p>
<p>Best of luck,</p>
<p>Rob</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scott</title>
		<link>http://www.oak-tree.us/blog/index.php/2009/05/12/pyqt-mac/comment-page-1#comment-2517</link>
		<dc:creator>Scott</dc:creator>
		<pubDate>Tue, 16 Jun 2009 06:07:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.oak-tree.us/blog/?p=896#comment-2517</guid>
		<description>Thanks for the tutorial, it was extremely helpful!  I&#039;m just having a small issue including PyQt libraries.  Everything is present in /Library/Python/2.5/site-packages/PyQt4 such as the .so files, but my script still won&#039;t run.  It&#039;s almost as if it&#039;s not finding these libraries because this is the error I&#039;m getting:

from PyQt4 import QtCore, QtGui
ImportError: cannot import name QtCore

I&#039;ve checked sys.path and site-packages is listed so I&#039;m kinda at a loss here.  Any ideas?  Thanks!</description>
		<content:encoded><![CDATA[<p>Thanks for the tutorial, it was extremely helpful!  I'm just having a small issue including PyQt libraries.  Everything is present in /Library/Python/2.5/site-packages/PyQt4 such as the .so files, but my script still won't run.  It's almost as if it's not finding these libraries because this is the error I'm getting:</p>
<p>from PyQt4 import QtCore, QtGui<br />
ImportError: cannot import name QtCore</p>
<p>I've checked sys.path and site-packages is listed so I'm kinda at a loss here.  Any ideas?  Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Apolitically Incorrect &#187; Cross Platform GUI Development with Python and Qt</title>
		<link>http://www.oak-tree.us/blog/index.php/2009/05/12/pyqt-mac/comment-page-1#comment-1334</link>
		<dc:creator>Apolitically Incorrect &#187; Cross Platform GUI Development with Python and Qt</dc:creator>
		<pubDate>Tue, 12 May 2009 21:40:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.oak-tree.us/blog/?p=896#comment-1334</guid>
		<description>[...] Art and Photography                     &#171; Installation of PyQt on Mac OS X [...]</description>
		<content:encoded><![CDATA[<p>[...] Art and Photography                     &laquo; Installation of PyQt on Mac OS X [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>

