sciapp / gr

GR framework: a graphics library for visualisation applications
Other
327 stars 54 forks source link

Latest version from pip not working on Windows for NICOS #181

Closed aglavic closed 4 months ago

aglavic commented 11 months ago

NICOS installed on windows using pip does not show any plots, giving the following error message:

GKS: qt5plugin.dll: can't load library, error 126 (0x7e)

Investigation shows that the file exists in the gr directory but is either not found or somehow corrupted. Copying it to another folder that is used during dll loads does not solve the problem.

jheinen commented 11 months ago

Unfortunately, I cannot reproduce the problem. Which gr version is used/installed?

Does a simple GR script work?

import gr
gr.text(0.5, 0.5, 'Hello World')
gr.updatews()
IngoMeyer441 commented 11 months ago

This problem can be caused when GR is used together with PyQt on Windows (both installed with pip). Could you please try to set

set GR_BUILD_VARIANT=msvc

in the command line, before installing GR with pip? This forces to download GR binaries which were built with MSVC and are compatible with the PyQt runtime.

IngoMeyer441 commented 11 months ago

One important addition: Please add the --no-cache-dir option to the pip call, otherwise the GR_BUILD_VARIANT environment variable will effectively be ignored.

aglavic commented 11 months ago

Thanks @IngoMeyer441 , this solved the problem. Can you put this in the next distribution as a fix or in the nicos requirements so others don't have the issue?

IngoMeyer441 commented 11 months ago

IMHO, we should make the MSVC GR binaries the default on Windows when installing python-gr. This should solve the issues.

IngoMeyer441 commented 4 months ago

Since python-gr version v1.24.0 the MSVC build is used by default. So GR works with PyQt / PySide without setting any environment variables.