Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.maint.python > #12251 > unrolled thread

pyqt5 and entrypoint

Started byPICCA Frederic-Emmanuel <frederic-emmanuel.picca@synchrotron-soleil.fr>
First post2020-02-02 21:50 +0100
Last post2020-02-03 03:20 +0100
Articles 4 — 3 participants

Back to article view | Back to linux.debian.maint.python


Contents

  pyqt5 and entrypoint PICCA Frederic-Emmanuel <frederic-emmanuel.picca@synchrotron-soleil.fr> - 2020-02-02 21:50 +0100
    Re: pyqt5 and entrypoint Dmitry Shachnev <mitya57@debian.org> - 2020-02-02 22:40 +0100
      RE:pyqt5 and entrypoint PICCA Frederic-Emmanuel <frederic-emmanuel.picca@synchrotron-soleil.fr> - 2020-02-02 23:20 +0100
        RE:pyqt5 and entrypoint Scott Kitterman <debian@kitterman.com> - 2020-02-03 03:20 +0100

#12251 — pyqt5 and entrypoint

FromPICCA Frederic-Emmanuel <frederic-emmanuel.picca@synchrotron-soleil.fr>
Date2020-02-02 21:50 +0100
Subjectpyqt5 and entrypoint
Message-ID<zvulP-6HQ-5@gated-at.bofh.it>
Hello,

We are working on the next pyfai package.

This new version use entry_points like this


 gui_requires = ['PyQt5', 'h5py', 'hdf5plugin', 'PyOpenGL']
    opencl_requires = ['pyopencl']
    extras_require = {
        'calib2': gui_requires,  # Keep compatibility
        'gui': gui_requires,
        'opencl': opencl_requires,
        'full': gui_requires + opencl_requires,
    }

    console_scripts = [
        'check_calib = pyFAI.app.check_calib:main',
        'detector2nexus = pyFAI.app.detector2nexus:main',
        'diff_map = pyFAI.app.diff_map:main',
        'diff_tomo = pyFAI.app.diff_tomo:main',
        'eiger-mask = pyFAI.app.eiger_mask:main',
        'MX-calibrate = pyFAI.app.mx_calibrate:main',
        'pyFAI-average = pyFAI.app.average:main',
        'pyFAI-benchmark = pyFAI.app.benchmark:main',
        'pyFAI-calib = pyFAI.app.calib:main',
        'pyFAI-calib2 = pyFAI.app.calib2:main [gui]',
        'pyFAI-drawmask = pyFAI.app.drawmask:main',
        'pyFAI-diffmap = pyFAI.app.diff_map:main',
        'pyFAI-integrate = pyFAI.app.integrate:main',
        'pyFAI-recalib = pyFAI.app.recalib:main',
        'pyFAI-saxs = pyFAI.app.saxs:main',
        'pyFAI-waxs = pyFAI.app.waxs:main',
    ]

    entry_points = {
        'console_scripts': console_scripts,
        # 'gui_scripts': [],
    }



But once installed, we can not start the gui application.


jerome@patagonia:~/workspace/hdf5plugin$ pyFAI-calib2
Traceback (most recent call last):
  File "/usr/bin/pyFAI-calib2", line 11, in <module>
    load_entry_point('pyFAI==0.19.0', 'console_scripts', 'pyFAI-calib2')()
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 489, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2793, in load_entry_point
    return ep.load()
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2410, in load
    self.require(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2433, in require
    items = working_set.resolve(reqs, env, installer, extras=self.extras)
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 786, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'PyQt5' distribution was not
found and is required by the application


indeed python3-pyqt5 was installed

so Is it a bug in the pyqt5 package, or is there a way to fix this in Debian.

thanks for your help

Frederic

[toc] | [next] | [standalone]


#12252

FromDmitry Shachnev <mitya57@debian.org>
Date2020-02-02 22:40 +0100
Message-ID<zvv8d-7cx-1@gated-at.bofh.it>
In reply to#12251

[Multipart message — attachments visible in raw view] — view raw

Hi,

On Sun, Feb 02, 2020 at 08:21:51PM +0000, PICCA Frederic-Emmanuel wrote:
> Hello,
>
> We are working on the next pyfai package.
>
> This new version use entry_points like this
> [...]
>
> But once installed, we can not start the gui application.
> [...]
>
> pkg_resources.DistributionNotFound: The 'PyQt5' distribution was not
> found and is required by the application
>
> indeed python3-pyqt5 was installed

Please make sure you have python3-pyqt5 ≥ 5.12+dfsg-1.

If that is the case and you are still getting an error, please check
the output of the following commands in the Python console:

>>> import pkg_resources
>>> pkg_resources.get_distribution('PyQt5')

For me it prints “PyQt5 5.14.1 (/usr/lib/python3/dist-packages)”.

--
Dmitry Shachnev

[toc] | [prev] | [next] | [standalone]


#12253

FromPICCA Frederic-Emmanuel <frederic-emmanuel.picca@synchrotron-soleil.fr>
Date2020-02-02 23:20 +0100
Message-ID<zvvKV-7EL-1@gated-at.bofh.it>
In reply to#12252
Hello

on unstable it works but on buster (and we need to make it work for buster)
we have this message

Python 3.7.3 (default, Apr  3 2019, 05:39:12) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pkg_resources
>>> pkg_resources.get_distribution('PyQt5')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 481, in get_distribution
    dist = get_provider(dist)
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 357, in get_provider
    return working_set.find(moduleOrReq) or require(str(moduleOrReq))[0]
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 900, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 786, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'PyQt5' distribution was not found and is required by the application

[toc] | [prev] | [next] | [standalone]


#12255

FromScott Kitterman <debian@kitterman.com>
Date2020-02-03 03:20 +0100
Message-ID<zvzve-1pM-21@gated-at.bofh.it>
In reply to#12253

On February 2, 2020 9:58:45 PM UTC, PICCA Frederic-Emmanuel <frederic-emmanuel.picca@synchrotron-soleil.fr> wrote:
>Hello
>
>on unstable it works but on buster (and we need to make it work for
>buster)
>we have this message
>
>Python 3.7.3 (default, Apr  3 2019, 05:39:12) 
>[GCC 8.3.0] on linux
>Type "help", "copyright", "credits" or "license" for more information.
>>>> import pkg_resources
>>>> pkg_resources.get_distribution('PyQt5')
>Traceback (most recent call last):
>  File "<stdin>", line 1, in <module>
>File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line
>481, in get_distribution
>    dist = get_provider(dist)
>File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line
>357, in get_provider
>   return working_set.find(moduleOrReq) or require(str(moduleOrReq))[0]
>File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line
>900, in require
>    needed = self.resolve(parse_requirements(requirements))
>File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line
>786, in resolve
>    raise DistributionNotFound(req, requirers)
>pkg_resources.DistributionNotFound: The 'PyQt5' distribution was not
>found and is required by the application

Since you know that the dependency is satisfied due to your package dependencies in debian/control, you should be able to patch away the requires PyQt5 in setup.py and it'll work fine.

Scott K

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.maint.python


csiph-web