Failure to import PyQt4.QtGui and PyQt4.QtCore modules

All questions about installation
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
edwilkes

Failure to import PyQt4.QtGui and PyQt4.QtCore modules

Post by edwilkes »

After a complete build of CS 2.0.4 on our HP cluster (CentOS 5.2, Intel 11.1-059 compiler suite) I have not been able to bring up the GUI with "code_saturne gui" - I get this message:
Error: Unable to import PyQt4.QtCore or PyQt4.QtGui modules.
Please check your PyQt4 installation
For this package, I downloaded and built a private copy of Python 2.7.2 for sip and PyQt4 to add the necessry pieces. For these modules, I have verified the presence of the following files:

[SYRTHES4.0.0-BETA_TOP_DIR]/src/syrthes-gui/exe.linux-x86_64_calibre7/PyQt4.QtCore.so
[SYRTHES4.0.0-BETA_TOP_DIR]/src/syrthes-gui/exe.linux-x86_64_calibre7/PyQt4.QtGui.so
[PYQT4_INSTALL_DIR]QtCore/QtCore.so
[PYQT4_INSTALL_DIR]/QtGui/QtGui.so
[PYTHON_INSTALL_DIR]/lib/python2.7/site-packages/PyQt4/QtCore.so
[PYTHON_INSTALL_DIR]/lib/python2.7/site-packages/PyQt4/QtGui.so
[PYTHON_INSTALL_DIR]/share/sip/PyQt4/QtCore/QtCoremod.sip
[PYTHON_INSTALL_DIR]/share/sip/PyQt4/QtGui/QtGuimod.sip

I did not receive any other indication that either the PyQt4 (version 4.9.1) build or the CS build was bad. I did take care to ensure that this Python implementation occurs in the PATH before the system-installed earlier version.

So what can cause the reported error even if the modules are present? Are there some things I can check for? Could I be missing any needed environment variables?

Thanks, Ed
Yvan Fournier
Posts: 4080
Joined: Mon Feb 20, 2012 3:25 pm

Re: Failure to import PyQt4.QtGui and PyQt4.QtCore modules

Post by Yvan Fournier »

Hello,

If you use a precompiled version of Qt4 (you seem to be using the one from SYRTHES), and it was moved there might be some other environment variables to set (I am not sure).

To test that PyQt4 (the Python + SIP + Qt4) works well, the simplest test is to run Python in a terminal (with your same environment variables set), and then type "import PyQt4.QyCore".

If this works, the issue is with the way Code_Saturne updates or overloads your environment. If it fails, there is a problem in your PyQt4 installation, so either way, I would start there to see in which direction to search.

Best regards,

Yvan
edwilkes

Re: Failure to import PyQt4.QtGui and PyQt4.QtCore modules

Post by edwilkes »

All of the code was downloaded and compiled locally from source. I ran the suggested test by launching the local Python in the same window then trying "import PyQt4.QtCore" and "import PyQt4.QtGui" - no error was indicated for either one so at least Python can find the modules.

So if there is an issue with my run environment, how can I diagnose this?

Thanks, Ed
Yvan Fournier
Posts: 4080
Joined: Mon Feb 20, 2012 3:25 pm

Re: Failure to import PyQt4.QtGui and PyQt4.QtCore modules

Post by Yvan Fournier »

Hello,

Are you running under Fedora Linux or on a cluster on which environment modules are used ?
We recently fixed a bug with environment modules support in which environment variables could be overwritten (upon install more than execution if I rememeber correctly, but this may have side effects which could explain your bug).

That bug has been fixed in Code_Saturne 2.0.5, which was released a few days ago, so you may want to download it (from the Download tab on this site) and try it.

If this does not help, I'll have to tell you where to insert logging code in the scripts for further troubleshooting, but hopefully this won't be necessary.

Best regards,

Yvan
edwilkes

Re: Failure to import PyQt4.QtGui and PyQt4.QtCore modules

Post by edwilkes »

Thanks for your continued help. Yes, our Linux platform does use modules which are used extensively to compile codes and may also be needed at runtime. For CS I have loaded a module for the Intel compilers, one for IMPI and one for the specific Python 2.7.2 installation which has SIP and PyQt4 attached to it. Since the system has a default Python 2.4.3, my version is accessed only by the module.

I think it would be simplest to try version 2.0.5, but I cannot find a link to this version. Here are the currently showing stable release links on the download page:

NCS: 2.0.4
ECS: 2.0.2
BFT: 1.1.5
FVM: 0.15.3
MEI: 1.0.3

If you can add a link for NCS 2.0.5, I should be able to reach it. Do any of the other packages have to be upgraded at the same time?

Thanks, Ed
Yvan Fournier
Posts: 4080
Joined: Mon Feb 20, 2012 3:25 pm

Re: Failure to import PyQt4.QtGui and PyQt4.QtCore modules

Post by Yvan Fournier »

Hello,

The new download section is on this same website:

http://code-saturne.org/cms/download/versions

Or directly in:

http://code-saturne.org/releases/

And no, BFT, MEI, FVM, ... do not need to be upgraded.

Best regards,

Yvan
edwilkes

Re: Failure to import PyQt4.QtGui and PyQt4.QtCore modules

Post by edwilkes »

I obtained and built NCS 2.0.5 and that worked for me - thanks! Nothing else had to be rebuilt.
Post Reply