[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: [PyQt] pyqtdeploy build can't find modules
From:       Phil Thompson <phil () riverbankcomputing ! com>
Date:       2016-03-27 17:24:05
Message-ID: D6CBB08D-594C-40CD-999B-3CB4C1B1C5D0 () riverbankcomputing ! com
[Download RAW message or body]

On 19 Mar 2016, at 1:39 pm, David Beck <dbeck@ualberta.ca> wrote:
> 
> Here you are. I've included both the regular one and the flat one. 
> 
> Appreciate the help.
> 
> David
> 
> <Test_projects.tar.gz>
> > > 
> > > The second project is flat, with no .ui module:
> > > 
> > > MiniBrowserflat
> > > 	__init__.py
> > > 	minibrowser.py
> > > 	mainwindow.py
> > > 	mainwindow.ui
> > > 	Ui_mainwindow.py
> > > 
> > > When I try to build that, I get essentially the same thing:
> > > 
> > > make succeeded.
> > > Running MiniBrowser...
> > > Running '/Users/David/OpenSource/PyQtDeploy/sysroot-macosx/build/MiniBrowser.app/Contents/MacOS/MiniBrowser'
> > >  /Users/David/OpenSource/PyQtDeploy/sysroot-macosx/build/MiniBrowser.app/Contents/MacOS/MiniBrowser \
> > > failed. Traceback (most recent call last):
> > > File "minibrowser.py", line 2, in <module>
> > > File "bootstrap.py", line 969, in _find_and_load
> > > File "bootstrap.py", line 956, in _find_and_load_unlocked
> > > ImportError: No module named ‘mainwindow'
> > > 
> > > This seems to be caused, again, by an import command
> > > 
> > > 	from mainwindow import MainWindow
> > > 
> > > in the main script file.

I've only looked at the flat version.

The top-level package will be MiniBrowserflat - in a conventional installation this \
directory would be a sub-directory of site-packages. The main script (minibrowser.py) \
is not part of this package even though in this case it is in the same directory. \
Therefore the import statement in minibrowser.py should be...

from MiniBrowserflat.mainwindow import MainWindow

For the same reason the import in mainwindow.py should be...

from .Ui_mainwindow import Ui_MainWindow

This will deploy properly. However it will no longer run normally - unless you set \
PYTHONPATH. To get it to work unchanged in both circumstances move minibrowser.py to \
its parent directory so that it is side by side with the MiniBrowserflat directory.

Phil
_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
https://www.riverbankcomputing.com/mailman/listinfo/pyqt


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic