[PyQt] pyqtdeploy-build fails for iOS app

David Morris othalan at othalan.net
Thu Jun 14 16:44:13 BST 2018


I am attempting to update a project to pyqtdeploy 2.0.  I have the sysroot
setup, but when attempting to build my application I get an import error
for PyQt5.QtCore.  PyQt5 is setup and runs my app perfectly, and pyqtdeploy
itself runs perfectly.  Below is the actual error.  Any ideas on what I did
wrong?

Note that I am using a pyenv virtual environment (pyenv virtualenv) if that
is relevant .....

*Compile OS:*  MacOS High Sierra (10.13.4)

pyqtdeploy-build --build-dir /Users/morrisde/contract/Piran
> haColorQt10/ios/sysroot_test/pump --target ios-64 --sysroot
> /Users/morrisde/contract/PiranhaColorQt10/ios/sysroot_test pump.pdy
> Traceback (most recent call last):
>   File "/usr/local/var/pyenv/versions/piranha-qt5/bin/pyqtdeploy-build",
> line 11, in <module>
>     load_entry_point('pyqtdeploy==0.0.dev0', 'console_scripts',
> 'pyqtdeploy-build')()
>   File "/usr/local/var/pyenv/versions/piranha-qt5/lib/python3.6/
> site-packages/pkg_resources/__init__.py", line 480, in load_entry_point
>     return get_distribution(dist).load_entry_point(group, name)
>   File "/usr/local/var/pyenv/versions/piranha-qt5/lib/python3.6/
> site-packages/pkg_resources/__init__.py", line 2693, in load_entry_point
>     return ep.load()
>   File "/usr/local/var/pyenv/versions/piranha-qt5/lib/python3.6/
> site-packages/pkg_resources/__init__.py", line 2324, in load
>     return self.resolve()
>   File "/usr/local/var/pyenv/versions/piranha-qt5/lib/python3.6/
> site-packages/pkg_resources/__init__.py", line 2330, in resolve
>     module = __import__(self.module_name, fromlist=['__name__'], level=0)
>   File "/usr/local/var/pyenv/versions/piranha-qt5/lib/python3.6/
> site-packages/pyqtdeploy-0.0.dev0-py3.6.egg/pyqtdeploy/__init__.py", line
> 28, in <module>
>     from .builder import Builder
>   File "/usr/local/var/pyenv/versions/piranha-qt5/lib/python3.6/
> site-packages/pyqtdeploy-0.0.dev0-py3.6.egg/pyqtdeploy/builder/__init__.py",
> line 28, in <module>
>     from .builder import Builder
>   File "/usr/local/var/pyenv/versions/piranha-qt5/lib/python3.6/
> site-packages/pyqtdeploy-0.0.dev0-py3.6.egg/pyqtdeploy/builder/builder.py",
> line 33, in <module>
>     from PyQt5.QtCore import (QByteArray, QCoreApplication, QDir, QFile,
> ModuleNotFoundError: No module named 'PyQt5.QtCore'
> make: *** [pump_xcode] Error 1



Examining the python environment used by the file "builder.py" referenced
in the traceback, I get the following information:

*sys.executable*: /usr/local/var/pyenv/versions/3.6.5/bin/python
*sys.path*: ['/usr/local/var/pyenv/versions/3.6.5/bin',
'/Users/morrisde/contract/PiranhaColorQt10/ios/sysroot_test/lib/python3.6/site-packages',
'/Users/morrisde/contract/PiranhaColorQt10/ios/sysroot_test/
lib/python3.6/site-packages/numpy-1.14.3-py3.6-macosx-10.13-x86_64.egg',
'/usr/local/var/pyenv/versions/3.6.5/lib/python36.zip',
'/usr/local/var/pyenv/versions/3.6.5/lib/python3.6',
'/usr/local/var/pyenv/versions/3.6.5/lib/python3.6/lib-dynload',
'/usr/local/var/pyenv/versions/3.6.5/lib/python3.6/site-packages',
'/usr/local/var/pyenv/versions/3.6.5/lib/python3.6/site-
packages/pyqtdeploy-0.0.dev0-py3.6.egg']


This looks wrong in two ways, though perhaps I am simply either doing
something wrong or misunderstanding what it should look like:


   1. I am using a pyenv virtual environment (pyenv virtualenv).  As such,
   the correct executable path should be whatever is setup by my pyenv
   environment:

   /usr/local/var/pyenv/shims/python

   It appears that pyqtdeploy-build is taking the real executable and
   ignoring the virtual environment, which breaks pyenv functionality.  (which
   is possibly acceptable in this situation except for the fact that I can't
   actually compile the iOS application).

   2. The python module path (sys.path) is missing the pyenv virtual
   environment site packages which should be found here:

   /usr/local/var/pyenv/versions/piranha-qt5/lib/python3.6/site-packages

   It appears that pyqtdeploy-build is looking for PyQt5 in the sysroot
   directory (/Users/morrisde/contract/PiranhaColorQt10/ios/sysroot_test/
   lib/python3.6/site-packages), however no PyQt5 installation exists in
   that location.


Can anyone help with how to setup an iOS build environment?
Is it possible to use pyenv (with or without a virtual environment)?
Or is there some other setup which must be used?
Or am I missing a build step?

I attached my sysroot.json config file in the previous email.  Here are the
build commands I am using (with full python virtualenv setup):

brew install pyenv pyenv-virtualenv
pyenv install 3.6.5
pyenv virtualenv -p python3.6 3.6.5 piranha-qt5
pyenv local piranha-qt5
pip install sip==4.19.8 pyqt5==5.10.1

pyqtdeploy-sysroot --sysroot ${HOME}/contract/PiranhaColorQt10/ios/sysroot_test
\
                   --source-dir ${HOME}/contract/pkgsrc sysroot.json \
                   --target ios-64

pyqtdeploy-build --build-dir
${HOME}/contract/PiranhaColorQt10/ios/sysroot_test/pump
\
                 --target ios-64 \
                 --sysroot ${HOME}/contract/PiranhaColorQt10/ios/sysroot_test
pump.pdy


Any help on what I am doing wrong?

Thank you,
David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20180614/10b965d4/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sysroot.json
Type: application/json
Size: 2116 bytes
Desc: not available
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20180614/10b965d4/attachment-0001.json>


More information about the PyQt mailing list