Help on installing PyQt on MacOSX 10.3 needed

S

svenn.are

Hi,

I wanted to run a program that is written in PyQt on my mac, and went
over to Riverbank to get PyQ 3.13 and SIP 4.1.1 sources.

I followed the installation guide except for the compiling python as
Macosx already has python.

I had no problem with compiling SIP and also no problem with compiling
PyQt nor did I have any error message during make install.

Now the last step in the install documentation says that I have to
edit several files regarding python itself, and then recompile it.
This is where I got stuck. The mac native python cannot find the
package qt with a import qt command on the commandline, and I have no
experience whatsoever with python.

Maybe somebody has been successful installing PyQt with the native
python in macosx 10.3 and can help me?
 
D

Diez B. Roggisch

Maybe somebody has been successful installing PyQt with the native
python in macosx 10.3 and can help me?

Try posting this on the pykde mailinglist, which is the authorative source
for pyqt os well.


http://mats.imk.fraunhofer.de/mailman/listinfo/pykde

Maybe there is something in the list archives - I don't look at mac related
questions there as I unfortunately don't own one of these nice pieces of
hardware...
 
K

Kevin Walzer

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I am working on a PyQt package bundle for OS X. I have everything
installed correctly on my Mac (10.3.6), and am running Eric3 without a
problem. Building everything isn't terribly difficult, but it is very
time-consuming (think two or three days of continuous compiling).
Putting together a package installer is actually harder than building it
because there are so many moving parts (patch Qt, build Qt, build
QScintilla, build SIP, build and install PyQt). I've gotten a
Sourceforge project approved, and as soon as I get everything worked
out, I will announce the release. So, if you can wait a little longer...


(e-mail address removed) wrote:
| Hi,
|
| I wanted to run a program that is written in PyQt on my mac, and went
| over to Riverbank to get PyQ 3.13 and SIP 4.1.1 sources.
|
| I followed the installation guide except for the compiling python as
| Macosx already has python.
|
| I had no problem with compiling SIP and also no problem with compiling
| PyQt nor did I have any error message during make install.
|
| Now the last step in the install documentation says that I have to
| edit several files regarding python itself, and then recompile it.
| This is where I got stuck. The mac native python cannot find the
| package qt with a import qt command on the commandline, and I have no
| experience whatsoever with python.
|
| Maybe somebody has been successful installing PyQt with the native
| python in macosx 10.3 and can help me?
|


- --
Kevin Walzer, PhD
WordTech Software--Open Source Applications and Packages for OS X
http://www.wordtech-software.com
http://www.smallbizmac.com
http://www.kevin-walzer.com
mailto:[email protected]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (Darwin)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFBkCCBJmdQs+6YVcoRAh8EAJwNFTUpXnCxV2fBbxIgjPTbiQHItwCgiyeN
Kf8GFPCPJOTkK3u3RYbd8JA=
=Kmx9
-----END PGP SIGNATURE-----
 
P

Phil Thompson

Hi,
I wanted to run a program that is written in PyQt on my mac, and went
over to Riverbank to get PyQ 3.13 and SIP 4.1.1 sources.

I followed the installation guide except for the compiling python as
Macosx already has python.

I had no problem with compiling SIP and also no problem with compiling
PyQt nor did I have any error message during make install.

Now the last step in the install documentation says that I have to
edit several files regarding python itself, and then recompile it.
This is where I got stuck. The mac native python cannot find the
package qt with a import qt command on the commandline, and I have no
experience whatsoever with python.

Maybe somebody has been successful installing PyQt with the native
python in macosx 10.3 and can help me?

Where does it say that you need to re-compile Python? You don't need to
touch Python - unless you are deploying applications and want to build a
version of Python with PyQt as builtin modules.

Phil
 
S

Svenn Are Bjerkem

Where does it say that you need to re-compile Python? You don't need to
touch Python - unless you are deploying applications and want to build a
version of Python with PyQt as builtin modules.

Hi Phil,

you are perfectly right. I went back to the documentation and paid a
bit more attention and with your information in mind, I now see that it
is talking about a selfcontained python with pyqt. I guess that I want
to use the qt bindings *dynamically*. That means that I have to find a
way to tell Python where to find the pyqt that I installed.

In tcl I would either have installed into a directory in auto_path or I
would have extended auto_path. How is this done in Python?

Kind regards,
 
K

Kevin Walzer

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Svenn Are Bjerkem wrote:

|
| you are perfectly right. I went back to the documentation and paid a bit
| more attention and with your information in mind, I now see that it is
| talking about a selfcontained python with pyqt. I guess that I want to
| use the qt bindings *dynamically*. That means that I have to find a way
| to tell Python where to find the pyqt that I installed.
|
| In tcl I would either have installed into a directory in auto_path or I
| would have extended auto_path. How is this done in Python?
|

PyQt is installed in the site-packages directory on OS X--there's
nothing special you need to do, it "just works" and loads up fine.


- --
Kevin Walzer, PhD
WordTech Software--Open Source Applications and Packages for OS X
http://www.wordtech-software.com
http://www.smallbizmac.com
http://www.kevin-walzer.com
mailto:[email protected]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (Darwin)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFBkTwRJmdQs+6YVcoRAj0rAJ9bRjtLXWTYZV5jFeyVBESisqbasgCdFwwa
lW+8v04/KiAWzKM6glr3PVE=
=ZpPs
-----END PGP SIGNATURE-----
 
S

Svenn Are Bjerkem

Kevin said:
Svenn Are Bjerkem wrote:

|
| you are perfectly right. I went back to the documentation and paid a bit
| more attention and with your information in mind, I now see that it is
| talking about a selfcontained python with pyqt. I guess that I want to
| use the qt bindings *dynamically*. That means that I have to find a way
| to tell Python where to find the pyqt that I installed.
|
| In tcl I would either have installed into a directory in auto_path or I
| would have extended auto_path. How is this done in Python?
|

PyQt is installed in the site-packages directory on OS X--there's
nothing special you need to do, it "just works" and loads up fine.

Well, then I must have done something wrong since I get the error
message that there is no module called qt available.

On the command line of Python I did import sys and print sys.path to get
the built-in search path. I checked the location where make install put
the pyqt build vs the list of directories in sys.path and found that
Python *should* be able to find pyqt. (There is a README file in that
directory saying that this is the place to put third-party files, but I
don't know if I have to do anything special in that sites.py which is
mentioned in that README file)

When I do import qt on the Python commandline, which file(s) in the
third-party directory will be searched for first? If I knew that I could
check if make install was successful generating all needed files.
 
K

Kevin Walzer

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Svenn Are Bjerkem wrote:

| Kevin Walzer wrote:
|
|> Svenn Are Bjerkem wrote:
|>
|> |
|> | you are perfectly right. I went back to the documentation and paid a
|> bit
|> | more attention and with your information in mind, I now see that it is
|> | talking about a selfcontained python with pyqt. I guess that I want to
|> | use the qt bindings *dynamically*. That means that I have to find a way
|> | to tell Python where to find the pyqt that I installed.
|> |
|> | In tcl I would either have installed into a directory in auto_path or I
|> | would have extended auto_path. How is this done in Python?
|> |
|>
|> PyQt is installed in the site-packages directory on OS X--there's
|> nothing special you need to do, it "just works" and loads up fine.
|
|
| Well, then I must have done something wrong since I get the error
| message that there is no module called qt available.
|
| On the command line of Python I did import sys and print sys.path to get
| the built-in search path. I checked the location where make install put
| the pyqt build vs the list of directories in sys.path and found that
| Python *should* be able to find pyqt. (There is a README file in that
| directory saying that this is the place to put third-party files, but I
| don't know if I have to do anything special in that sites.py which is
| mentioned in that README file)
|
| When I do import qt on the Python commandline, which file(s) in the
| third-party directory will be searched for first? If I knew that I could
| check if make install was successful generating all needed files.
|

How are you launching your program? Are you using pythonw instead of
Python? That's how to launch Python GUI programs on Mac OS X.

Do you have the MacPython add-ons installed? These make double-clicking
on Python apps the easiest way to launch them. See
http://homepages.cwi.nl/~jack/macpython/.

Also, my installer package is now live. See
http://www.wordtech-software.com/pyqt-mac.html. It installs most stuff
directly, then you just need to run sudo make install in the directories
for PyQt and Sip. It's a straightforward build, nothing fancy, and works
fine for me. Perhaps you should give that a try and see if you find it
helpful.

When I try to assemble a standalone verison of a PyQt app (using py2app,
like py2exe but on the Mac, with the Qt libraries), I do have problems
seeing the PyQt path--I get some of the same error messages that you are
seeing. I haven't figured out how to debug those yet. However, when just
running the script, or doing an applet bundle
(http://www.wordtech-software.com/python-applet-tutorial.html), things
run fine. I've bundled up Eric3 (released with my PyQt distro) and Kodos
(just on my own box) this way, and they work fine.

- --
Kevin Walzer, PhD
WordTech Software--Open Source Applications and Packages for OS X
http://www.wordtech-software.com
http://www.smallbizmac.com
http://www.kevin-walzer.com
mailto:[email protected]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (Darwin)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFBke0tJmdQs+6YVcoRAqOUAJ4/Vzj77nud2hqbzzCv/sKZ1CuCPgCgi5b9
aV8JEbxCTR08WzIsHCCUg3c=
=j8KC
-----END PGP SIGNATURE-----
 
S

Svenn Are Bjerkem

Kevin said:
How are you launching your program? Are you using pythonw instead of
Python? That's how to launch Python GUI programs on Mac OS X.

I have used python until this advice. After reading your advice I tried
pythonw, but on its commandline I got the same error message that qt is
not a module. Somewhere down the compile and install pipe a file that
python need to know that qt is available must have slipped through.
Do you have the MacPython add-ons installed? These make double-clicking
on Python apps the easiest way to launch them. See
http://homepages.cwi.nl/~jack/macpython/.

Yes, I have installed the MacPython add-ons. So far I haven't
experimented with it, but I will now.
Also, my installer package is now live. See
http://www.wordtech-software.com/pyqt-mac.html. It installs most stuff
directly, then you just need to run sudo make install in the directories
for PyQt and Sip. It's a straightforward build, nothing fancy, and works
fine for me. Perhaps you should give that a try and see if you find it
helpful.

But I have already installed Mac/qt by myself, and it is working. I
don't know what will happen if I start to install something on top of
it. Do you have a possibility to create a version that do not include
Mac/qt, or will this make no sense?

I hope to get some more time to play with python and qt this evening,
and then I will check some of your advices.

Thanks,
 
S

Svenn Are Bjerkem

PyQt is installed in the site-packages directory on OS X--there's
nothing special you need to do, it "just works" and loads up fine.

Am I supposed to create static or dynamic libraries for sip and pyqt if
I only want to use with the MacOSX python?
 
S

Svenn Are Bjerkem

Am I supposed to create static or dynamic libraries for sip and pyqt if
I only want to use with the MacOSX python?

Yes, I am.
I discovered that I followed an installation description that made
static libraries. That little -k at the end in python configure.py -k
was no good. I removed it, compiled sip and pyqt again, and then I
could import those modules into python.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top