[PyQt] pyqtdeploy - other packages...

John M. Hackett john.hackett at icon-is.co.uk
Mon Nov 2 13:46:01 GMT 2015

The app I am trying to build uses some third party modules including pacparser ( https://github.com/pacparser/pacparser ). Using pyqtdeploy and after some pointers from Phil the project will qmake OK and, in general, appears to "make". 

However when I run the app it fails to import pacparser. 

There are, in fact, three external modules and a directory for each is created in the /build/resources directory. The build instructions for pacparser are straightforward but do not give a static option. 

Compiling and installing pacparser is as easy as running the following 


=> make -C src 

=> sudo make -C src install 


To compile and install pacparser python module: 

=> make -C src pymod 
=> sudo make -C src install-pymod 

There are no error messages and all tests are successful in the process. After this we have a library "/usr/lib/libpacparser.so" and a module here "/usr/local/lib/python2.7/dist-packages/pacparser" containing three files: __init__.py, __init__.pyc and _pacparser.so 

This path is used in the "Other Packages" tab of pyqtdeploy and this and the other two modules are checked for inclusion. 

Then I run "build" with qmake checked. 

Then I edit out the "-lintl" in the Makefile and run make. 

If I run the built app now I get this error: 

root at ubuntu14:~/build# ./ProtexLoginApp 
Traceback (most recent call last): 
File "PythonLogin_v1.03.py", line 43, in <module> 
File ":/pacparser/__init__.pyo", line 31, in <module> 
ImportError: cannot import name _pacparser 

If I follow the notes under "sys.path" in the tutorial ( http://pyqt.sourceforge.net/Docs/pyqtdeploy/tutorial.html ) for non-static modules and copy the generated _ pacparser.so to "pacparser._pacparser.so" in the same directory as the built app I get: 

Traceback (most recent call last): 
File "PythonLogin_v1.03.py", line 43, in <module> 
File ":/pacparser/__init__.pyo", line 31, in <module> 
ImportError: Don't know how to import pacparser._pacparser (type code 3) 

So, it looks as thought the app is looking for this filename to fulfil the import statement ("import pacparser") but for some reason is unable to import it. 

I must be doing something wrong or missing out a stage but can't figure out what! 


John Hackett 
Icon Information Systems 
74 Gibsons Hill, Norbury, London, SW16 3JS 
t: 020 8764 2663 
f: 020 8711 3370 
m: 07801-231118 
e: john.hackett at icon-is.co.uk 
w: www.icon-is.co.uk 
skype: john_hackett 
twitter: @iconinfosys 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20151102/f8599725/attachment.html>

More information about the PyQt mailing list