Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

qutip not handling environments without gui correctly #24

Closed
arnelg opened this issue May 31, 2013 · 3 comments
Closed

qutip not handling environments without gui correctly #24

arnelg opened this issue May 31, 2013 · 3 comments
Assignees
Milestone

Comments

@arnelg
Copy link
Member

arnelg commented May 31, 2013

Hi guys,

I'm running qutip on an environment without any gui. qutip correctly sets

qutip.settings.qutip_gui = 'NONE'
os.environ['QUTIP_GUI'] = 'NONE'

as I have checked.

However, it still import modules like gui/about, gui/syntax etc., that does not handle os.environ['QUTIP_GUI'] = 'NONE'. For example, these lines are from gui/about.py:

if os.environ['QUTIP_GUI'] == "PYSIDE":
    from PySide import QtGui, QtCore

elif os.environ['QUTIP_GUI'] == "PYQT4":
    from PyQt4 import QtGui, QtCore

but there is not similar handling for the "NONE" option, and you thus get a NameError every time QtGui or QtCore is used later on...

qutip version: 2.3.0.dev-30fb431

@ghost ghost assigned jrjohansson May 31, 2013
@jrjohansson
Copy link
Member

Hi Arne

Thanks a lot for the bug report. I'll go through the code fix it so that the qutip_gui = NONE flag is handled consistently. In the long run I think we need to refactor the code a little bit, so that GUI dependent module aren't imported at all if qutip_gui = NONE, rather that having a lot of if-else statements scattered around, but for now I'll try to make a quick fix by adding more if statements..

Rob

@arnelg
Copy link
Member Author

arnelg commented May 31, 2013

Hi Rob,

No problem. By the way, this bug isn't there in qutip v2.2.0.

Arne

@jrjohansson
Copy link
Member

I think that 4fa8929 fixes this problem.

splch pushed a commit to splch/qutip that referenced this issue Nov 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants