<html><body><div style="font-family: Arial; font-size: 10pt; color: #000000"><div>The app I am trying to build uses some third party modules including pacparser (<a href="https://github.com/pacparser/pacparser">https://github.com/pacparser/pacparser</a>). Using pyqtdeploy and after some pointers from Phil the project will qmake OK and, in general, appears to "make".</div><div><br></div><div>However when I run the app it fails to import pacparser.</div><div><br></div><div>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.</div><div><br></div><div><table class="highlight tab-size js-file-line-container mceItemTable" data-tab-size="8" style="padding-left: 30px;"><tbody style="padding-left: 30px;"><tr style="padding-left: 30px;"></tr><tr style="padding-left: 30px;"></tr><tr style="padding-left: 30px;"><td id="LC13" class="blob-code blob-code-inner js-file-line" style="padding-left: 30px;"><span style="font-family: 'courier new', courier, monaco, monospace, sans-serif;" data-mce-style="font-family: 'courier new', courier, monaco, monospace, sans-serif;">Compiling and installing pacparser is as easy as running the following</span></td></tr><tr style="padding-left: 30px;"></tr><tr style="padding-left: 30px;"></tr><tr style="padding-left: 30px;"><td id="LC14" class="blob-code blob-code-inner js-file-line" style="padding-left: 30px;"><span style="font-family: 'courier new', courier, monaco, monospace, sans-serif;" data-mce-style="font-family: 'courier new', courier, monaco, monospace, sans-serif;">commands:</span></td></tr><tr style="padding-left: 30px;"></tr><tr style="padding-left: 30px;"></tr><tr style="padding-left: 30px;"><td id="LC15" class="blob-code blob-code-inner js-file-line" style="padding-left: 30px;"><span style="font-family: 'courier new', courier, monaco, monospace, sans-serif;" data-mce-style="font-family: 'courier new', courier, monaco, monospace, sans-serif;">=> make -C src</span></td></tr><tr style="padding-left: 30px;"></tr><tr style="padding-left: 30px;"></tr><tr style="padding-left: 30px;"><td id="LC16" class="blob-code blob-code-inner js-file-line" style="padding-left: 30px;"><span style="font-family: 'courier new', courier, monaco, monospace, sans-serif;" data-mce-style="font-family: 'courier new', courier, monaco, monospace, sans-serif;">=> sudo make -C src install</span></td></tr><tr style="padding-left: 30px;"></tr><tr style="padding-left: 30px;"></tr><tr style="padding-left: 30px;"><td id="LC17" class="blob-code blob-code-inner js-file-line" style="padding-left: 30px;"></td></tr><tr style="padding-left: 30px;"></tr><tr style="padding-left: 30px;"></tr><tr style="padding-left: 30px;"><td id="LC18" class="blob-code blob-code-inner js-file-line" style="padding-left: 30px;"><span style="font-family: 'courier new', courier, monaco, monospace, sans-serif;" data-mce-style="font-family: 'courier new', courier, monaco, monospace, sans-serif;"><br></span></td></tr><tr style="padding-left: 30px;"></tr><tr style="padding-left: 30px;"></tr><tr style="padding-left: 30px;"><td id="LC19" class="blob-code blob-code-inner js-file-line" style="padding-left: 30px;"><span style="font-family: 'courier new', courier, monaco, monospace, sans-serif;" data-mce-style="font-family: 'courier new', courier, monaco, monospace, sans-serif;">------------------------------------------------</span></td></tr><tr style="padding-left: 30px;"></tr><tr style="padding-left: 30px;"></tr><tr style="padding-left: 30px;"><td id="LC20" class="blob-code blob-code-inner js-file-line" style="padding-left: 30px;"><span style="font-family: 'courier new', courier, monaco, monospace, sans-serif;" data-mce-style="font-family: 'courier new', courier, monaco, monospace, sans-serif;">To compile and install pacparser python module:</span></td></tr><tr style="padding-left: 30px;"></tr><tr style="padding-left: 30px;"></tr><tr style="padding-left: 30px;"><td id="LC21" class="blob-code blob-code-inner js-file-line" style="padding-left: 30px;"><span style="font-family: 'courier new', courier, monaco, monospace, sans-serif;" data-mce-style="font-family: 'courier new', courier, monaco, monospace, sans-serif;">=> make -C src pymod</span></td></tr><tr style="padding-left: 30px;"></tr></tbody></table><table class="highlight tab-size js-file-line-container mceItemTable" data-tab-size="8" style="padding-left: 60px;"><tbody><tr><td id="LC22" class="blob-code blob-code-inner js-file-line"><span style="font-family: 'courier new', courier, monaco, monospace, sans-serif;" data-mce-style="font-family: 'courier new', courier, monaco, monospace, sans-serif;">=> sudo make -C src install-pymod</span></td></tr></tbody></table><div><br></div></div><div>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</div><div><br></div><div>This path is used in the "Other Packages" tab of pyqtdeploy and this and the other two modules are checked for inclusion.</div><div><br></div><div>Then  I run "build" with qmake checked.</div><div><br></div><div>Then I edit out the "-lintl" in the Makefile and run make.</div><div><br></div><div>If I run the built app now I get this error:</div><div><br></div><div><p style="margin: 0px; padding-left: 30px;"><span style="font-family: 'courier new', courier, monaco, monospace, sans-serif;" data-mce-style="font-family: 'courier new', courier, monaco, monospace, sans-serif;">root@ubuntu14:~/build# ./ProtexLoginApp </span><br><span style="font-family: 'courier new', courier, monaco, monospace, sans-serif;" data-mce-style="font-family: 'courier new', courier, monaco, monospace, sans-serif;">Traceback (most recent call last):</span><br><span style="font-family: 'courier new', courier, monaco, monospace, sans-serif;" data-mce-style="font-family: 'courier new', courier, monaco, monospace, sans-serif;"> File "PythonLogin_v1.03.py", line 43, in <module></span><br><span style="font-family: 'courier new', courier, monaco, monospace, sans-serif;" data-mce-style="font-family: 'courier new', courier, monaco, monospace, sans-serif;"> File ":/pacparser/__init__.pyo", line 31, in <module></span><br><span style="font-family: 'courier new', courier, monaco, monospace, sans-serif;" data-mce-style="font-family: 'courier new', courier, monaco, monospace, sans-serif;">ImportError: cannot import name _pacparser</span></p><p style="margin: 0px;" data-mce-style="margin: 0px;"><br></p><p style="margin: 0px;" data-mce-style="margin: 0px;"><br></p> If I follow the notes under "sys.path" in the tutorial (<a href="http://pyqt.sourceforge.net/Docs/pyqtdeploy/tutorial.html">http://pyqt.sourceforge.net/Docs/pyqtdeploy/tutorial.html</a>) for non-static modules and copy the generated _<span style="font-size: 13.3333px;" data-mce-style="font-size: 13.3333px;">pacparser.so to "pacparser._pacparser.so" in the same directory as the built app I get:</span></div><div><span style="font-size: 13.3333px;" data-mce-style="font-size: 13.3333px;"><br></span></div><div><span style="font-size: 13.3333px;" data-mce-style="font-size: 13.3333px;"><span style="font-size: 13.3333px;" data-mce-style="font-size: 13.3333px;"></span></span><p style="margin: 0px; padding-left: 30px;"><span style="font-family: 'courier new', courier, monaco, monospace, sans-serif;">Traceback (most recent call last):</span><br><span style="font-family: 'courier new', courier, monaco, monospace, sans-serif;"> File "PythonLogin_v1.03.py", line 43, in <module></span><br><span style="font-family: 'courier new', courier, monaco, monospace, sans-serif;"> File ":/pacparser/__init__.pyo", line 31, in <module></span><br><span style="font-family: 'courier new', courier, monaco, monospace, sans-serif;">ImportError: Don't know how to import pacparser._pacparser (type code 3)</span></p><p style="margin: 0px; padding-left: 30px;" data-mce-style="margin: 0px; padding-left: 30px;"><br><span style="font-family: 'courier new', courier, monaco, monospace, sans-serif;" data-mce-style="font-family: 'courier new', courier, monaco, monospace, sans-serif;"></span></p><p style="margin: 0px;" data-mce-style="margin: 0px;">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.</p><p style="margin: 0px;" data-mce-style="margin: 0px;"><br></p><p style="margin: 0px;" data-mce-style="margin: 0px;">I must be doing something wrong or missing out a stage but can't figure out what!</p><p style="margin: 0px;" data-mce-style="margin: 0px;"><br></p></div><div><span name="x"></span>-- <br>Regards,<br><div><br></div>John Hackett<br>Icon Information Systems<br>74 Gibsons Hill, Norbury, London, SW16 3JS<br>t: 020 8764 2663<br>f: 020 8711 3370<br>m: 07801-231118<br>e: john.hackett@icon-is.co.uk<br>w: www.icon-is.co.uk<br>skype: john_hackett<br>twitter: @iconinfosys<span name="x"></span><br></div><div><br></div></div></body></html>