Thursday, April 25, 2024
 Popular · Latest · Hot · Upcoming
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 3679  / 1 Year ago, sun, february 26, 2023, 10:05:20

I installed PyQt4 with synaptic.



I'm using Python3 so I need to configure the path for PyQt4 in eclipse, but it seems synaptic only installed PyQt4 for python 2 since I only found relative files and folders under python 2.6 and 2.7.



So how can I make PyQt4 to work with Python 3 and eclipse ?



Thanks.



UPDATE



I tried to configure it following this post: http://ubuntuforums.org/showthread.php?p=10914908#post10914908



But after following all the instructions without any error occurs in the way, I get error from running this code in python 3.2:



>>> import PyQt4


The error message is :



Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named PyQt4


But the strange thing is that the same code results NO error in python 2.7 (I have both 2.7 and 3.2 installed on my machine)


More From » python

 Answers
7

Should be possible. The source sits at Riverbank's site. However, compiling it might not be a one-line deal but should work. Have a look at a thread over at the ubuntuforum where eranga1988 had a similar problem.



Further down in that thread CoBrA2168 seems to give a solution:




  • download both SIP and PyQt4 from the official website

  • install qmake, python3.1-dev, gcc-c++ (for the g++ command), and the libqt4-dev.

  • then the compilation worked along the following lines

    python3.1 configure.py



    make



    sudo make install


  • note that some had to provide qmake's location to the call to python above:





    python configure.py -q /usr/lib/qt4/bin/qmake




    where they got the path to qmake from locate qmake




You might have to tune this to your version of Python 3. Good luck.


[#42462] Sunday, February 26, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ciousuntru

Total Points: 352
Total Questions: 124
Total Answers: 95

Location: Grenada
Member since Tue, Oct 12, 2021
3 Years ago
ciousuntru questions
;