pyqtdeploy: Using PythonModule

Patrick Stinson patrickkidd at gmail.com
Thu Oct 1 03:47:29 BST 2020


The answer is that you have to specify the root dir for the package or module. I did it like this (notice comment for alternative route using install() method):

    preinstalls = [ 'Python' ]
    provides = { 'six': PythonModule() }

    def get_archive_name(self):
        return ''

    """ Could also possibly get &.install() to copy six.py from
    os.path.join(os.path.dirname(os.path.abspath(__file__)), 'site-packages') to
    Component.target_modules_dir (/Users/patrick/dev/familydiagram/vendor/sysroot-macos-64/lib/python3.7/site-packages)
    so pyqtdeploy-build will automatically find it there.
    """
    target_modules_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'site-packages')

    def install(self):
        pass

> On Sep 30, 2020, at 4:43 PM, Patrick Stinson <patrickkidd at gmail.com> wrote:
> 
> Here is the component code, which really just provides a module name and minimum version number. I am using python-3.7.8.
> 
> from pyqtdeploy import Component, PythonModule
> 
> class SixComponent(Component):
> 
>     preinstalls = [ 'Python' ]
>     provides = { 'six': PythonModule(min_version=(3, 7)) }
> 
>     def get_archive_name(self):
>         return ''
> 
>     def install(self):
>         pass
> 
> 
>> On Sep 30, 2020, at 4:42 PM, Patrick Stinson <patrickkidd at gmail.com <mailto:patrickkidd at gmail.com>> wrote:
>> 
>> My pyqtdeploy sysroot is successfully finding the following component plugin for the third-party python module ‘six.py’. The module is checked in the “Other Packages” tab in the pyqtdeploy project. But I get an import error when importing it from my app code saying the module ‘six’ doesn’t exist. How does pyqtdeploy find the .py file for a PythonModule `provides` entry in a sysroot?
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20200930/0d38bffd/attachment.htm>


More information about the PyQt mailing list