View previous topic :: View next topic |
Author |
Message |
Damiatux Apprentice
Joined: 23 Feb 2008 Posts: 194
|
Posted: Thu May 13, 2010 2:33 pm Post subject: [PyQt4] ImportError: No module named PyQt4 [Résolu] |
|
|
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 |
|
|
Damiatux Apprentice
Joined: 23 Feb 2008 Posts: 194
|
Posted: Thu May 13, 2010 8:33 pm Post subject: |
|
|
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 |
|
|
Poussin l33t
Joined: 08 Jun 2007 Posts: 659 Location: Liège
|
Posted: Fri May 14, 2010 2:08 am Post subject: |
|
|
tu entends quoi par pas installé complètement? |
|
Back to top |
|
|
Damiatux Apprentice
Joined: 23 Feb 2008 Posts: 194
|
Posted: Fri May 14, 2010 6:47 am Post subject: |
|
|
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 |
|
|
Trapamoosch Apprentice
Joined: 08 May 2004 Posts: 203
|
Posted: Fri May 14, 2010 9:29 am Post subject: |
|
|
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 |
|
|
Damiatux Apprentice
Joined: 23 Feb 2008 Posts: 194
|
Posted: Sat May 15, 2010 12:05 pm Post subject: |
|
|
Bien. J'ai installé la version 3.1.2 de Python, recompilé sip et PyQt4 et ça marche |
|
Back to top |
|
|
|