-
Notifications
You must be signed in to change notification settings - Fork 65
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
Unable to use lantz.ui.app.Frontend #48
Comments
My naive approach was to simply remove the last two elements of class Frontend(QtGui.QMainWindow, metaclass=_FrontendType):
# ...
def __init__(self, parent=None, backend=None):
# ...
if self.gui:
for cls in self.__class__.__mro__[0:-2]: # <<< Change here.
# ... This (certainly) naive modification eliminates the previous error message. However it does raise a new problem: Traceback (most recent call last):
File "<ipython-input-1-d6e2c2282680>", line 1, in <module>
runfile('C:/[...]/test.py', wdir='C:/[...]')
File "C:\[...]\Anaconda\envs\py34\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 601, in runfile
execfile(filename, namespace)
File "C:\[...]\Anaconda\envs\py34\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 80, in execfile
exec(compile(open(filename, 'rb').read(), filename, 'exec'), namespace)
File "C:/[...]/test.py", line 20, in <module>
start_gui_app(app, FeatScanUi)
File "C:\[...]\Anaconda\envs\py34\lib\site-packages\lantz\ui\app.py", line 242, in start_gui_app
frontend = frontend_class(backend=backend)
File "C:\[...]\Anaconda\envs\py34\lib\site-packages\lantz\ui\app.py", line 139, in __init__
raise ValueError('{}: loading gui file {}'.format(self, self.gui))
ValueError: FeatScanUi: loading gui file scan.ui It seems to me that now, the condition |
@operte Thanks for the bug report. I have not seen this problem before. Can you tell me which Python version and PyQt version are you using? |
@hgrecco I am using Python 3.4.2, PyQt4 4.10.4 and Qt 4.8.6. I don't have PySide installed so I'm not certain that the issue you referenced is connected to this problem. |
I have roughly the same setup. and it works for me. I will try to mimick your installation, try it and let you know. |
@hgrecco Also I am running on Windows. Could it be related? |
I do not use Windows but I have tried it on windows. I am wondering if this is because you are running within IPython. Can you try it outside? |
Running this on a Python shell results in the same error message. I am going to try to install a new conda environment with the minimum amount of libraries necessary to check if my problem persists. |
I have access to a Windows computer tomorrow. I will try and let you know. |
Hi! I found the same problem that @operte. I'm using python 3.4.3 on windows. Any tips about how to solve that? |
@operte and @jflima11br are you both usiing PyQt or PySIDE? |
I'm using PyQt. |
I am not sure if you are still looking for an answer but I had a similar issue than the ones reported by @operte and @jflima11br. |
Hi @bizarri! Same problem here... everything is working. Thank you! |
Thanks @bizarri ! |
I'm new to Lantz but I found its features to match the requirements of an experiment I'm currently working on. I'm basing most of my development on the tutorial. I've already written the drivers for my device and wanted to start building a GUI. For that, I started the rich-app tutorial. However, I immediately ran into an error after running the first piece of code:
It seems the problem resides on a section of
lantz.ui.app.Frontend
:The elements inside
Frontend.__class__.__mro__
are:From this it seems the problem is when
for cls in self.__class__.__mro__
goes throughtype
andobject
. I think that since these two classes are built-ins,inspect.getfile(cls)
raises theTypeError
exception.I'm not certain if this problem is specific to my system or if it is a general issue. Could it be an incompatibility between lantz and my current libraries? I'm using Python 3.4 and I think that I have every library up-to-date.
The text was updated successfully, but these errors were encountered: