Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[PyQt4] ImportError: No module named PyQt4 [Résolu]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index French
View previous topic :: View next topic  
Author Message
Damiatux
Apprentice
Apprentice


Joined: 23 Feb 2008
Posts: 194

PostPosted: Thu May 13, 2010 2:33 pm    Post subject: [PyQt4] ImportError: No module named PyQt4 [Résolu] Reply with quote

Plop,

J'ai installé PyQt4 récemment, avec la version 4.6.2 de Qt et j'ai installé (pas complètement, pour éviter les problèmes avec Portage et tout le tralala) la version 3.1.2 de Python. J'ai fait un script très simple qui affiche une fenêtre vide. Mais lorsque je fais ./../Python-3.1.2/python pyqt.py, j'ai droit à cette erreur :
Code:
Traceback (most recent call last):
  File "pyqt.py", line 5, in <module>
    from PyQt4 import QtCore, QtGui
ImportError: No module named PyQt4


Pourquoi ? Comment régler ça ?

Merci d'avance,
Damiatux


Last edited by Damiatux on Sat May 15, 2010 12:05 pm; edited 1 time in total
Back to top
View user's profile Send private message
Damiatux
Apprentice
Apprentice


Joined: 23 Feb 2008
Posts: 194

PostPosted: Thu May 13, 2010 8:33 pm    Post subject: Reply with quote

J'ai testé le code avec la version 2.6 de Python, et ça marche. J'ai vu que PyQt4 se compilait avec la version 2.6 de Python. Donc si je veux utiliser la 3.1.2, il va falloir que je l'installe entièrement. Ça va pas causé un problème avec Portage et tout ?
Back to top
View user's profile Send private message
Poussin
l33t
l33t


Joined: 08 Jun 2007
Posts: 659
Location: Liège

PostPosted: Fri May 14, 2010 2:08 am    Post subject: Reply with quote

tu entends quoi par pas installé complètement?
Back to top
View user's profile Send private message
Damiatux
Apprentice
Apprentice


Joined: 23 Feb 2008
Posts: 194

PostPosted: Fri May 14, 2010 6:47 am    Post subject: Reply with quote

J'entends par là qu'il faut faire le make install, puisque que je me suis arrêté à la commande make.

EDIT: J'ai vu que la version 2.1.8.3 de Portage pouvait utiliser la version 3 de Python. Donc si j'installe complètement la version 3.1.2, ça va pas semer la pagaille dans mon système.
Back to top
View user's profile Send private message
Trapamoosch
Apprentice
Apprentice


Joined: 08 May 2004
Posts: 203

PostPosted: Fri May 14, 2010 9:29 am    Post subject: Reply with quote

Portage installe Python 3 en parallèle avec Python 2. Pour basculer de l'un à l'autre, tu peux faire "eselect python set X". Donc installer Python 3 avec Portage ne pose aucun souci.
Back to top
View user's profile Send private message
Damiatux
Apprentice
Apprentice


Joined: 23 Feb 2008
Posts: 194

PostPosted: Sat May 15, 2010 12:05 pm    Post subject: Reply with quote

Bien. J'ai installé la version 3.1.2 de Python, recompilé sip et PyQt4 et ça marche :)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index French All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum