Hi friends,
I've recently changed to ubuntu 9.04.. I've not had any problem with the installation of pyqt as it is available from the ubuntu repositories with umpteen number of packages.. Thanks to ubuntu for making my job easier.. Anyhow i've to download tarball file for python 3.1 and installed it.. I found that PyQt4 supports python 3.1(Am i right?)..

I wanted to check the pyqt installation with a sample program..
i

mport sys
from PyQt4 import QtGui
app=QtGui.QApplication(sys.argv)
widget=QtGui.QWidget()
widget.resize(250,150)
widget.setWindowTitle('Simple')
widget.show()

sys.exit(app.exec_())

when i issue the command

$python simple.py

it worked perfectly since it's executed with 2.6 installation..
But when i tried to execute it with

$python3 simple.py

it showed the error like

ImportError: No module named PyQt4

So i searched the sys.path for 2.6 and included
/

usr/lib/python2.6/dist-packages

in python3 sys.path...
Now when i tried to run this with python3 the error is like..

ImportError: /usr/lib/python2.6/dist-packages/PyQt4/QtGui.so: undefined symbol: PyString_FromString

I got the same error when i tried to execute another program... So can u please tell me how to solve this problem?? Am i heading in the right direction???...

Thanks & Regards...

So i searched the sys.path for 2.6 and included
usr/lib/python2.6/dist-packages
in python3 sys.path

So you are obviously using PyQT4 built for Python 2.6. The error message confirms it.

undefined symbol: PyString_FromString

Ask how to install PyQT for both 2.6 and 3.x on the Ubuntu or PyQt forum. Some one has done this and if there isn't anything in the repositories then there is probably a deb package that someone has made. Otherwise you will have to build from source against Python 3.x The good news is that if you screw up things, you can just re-install PyQT and get back to where you are now.

Thanks for posting back. I've saved the link as someone else will probably ask this again.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.