Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

genicam package for python 3.11 #386

Closed
jack77er opened this issue Jan 10, 2023 · 4 comments
Closed

genicam package for python 3.11 #386

jack77er opened this issue Jan 10, 2023 · 4 comments

Comments

@jack77er
Copy link

I know it is not really an harvesters bug, but I could not find any wheels or sources for the genicam 1.2.0 package for python 3.11 on windows. Is there any source or precompiled wheel available?

Thanks in advance

@MathijsNL
Copy link

You can download the .whl file from pypi.

https://pypi.org/project/genicam/#files

Extract the latest version (.whl is just a .zip) and edit the METADATA file so it includes version 3.11:

Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11

Zip the files and rename to .whl and install with:

pip install genicam-1.2.0-cp311-cp311-manylinux1_x86_64.whl

I do not recommend this method, if I would have to choose I would just use Python 3.10.

I did test it and the wheel for Genicam installed just fine, and I can import the harvester library and create a Harvester object. Other than that I did not test it.

@jack77er
Copy link
Author

Thanks for your response. Thats what I've tried, but the library is linked against the corresponding python library (python3xx.dll), in this case 3.10 as the last available:

 PS C:\Dev\Python3_11\Lib\site-packages\genicam> dlldiag.exe trace .\_genapi.pyd
DLL Diagnostic Tools version 0.0.18
Copyright (c) 2019-2021 Adam Rehn

Parsing module header and identifying non delay-loaded dependencies... done.

Identifying the module's delay-loaded dependencies... done.

Parsed module details:
Module:          C:\Dev\Python3_11\Lib\site-packages\genicam\_genapi.pyd
Type:            Dynamic-Link Library
Architecture:    x64

The module imports 10 direct dependencies:
api-ms-win-crt-heap-l1-1-0.dll
api-ms-win-crt-runtime-l1-1-0.dll
api-ms-win-crt-stdio-l1-1-0.dll
api-ms-win-crt-string-l1-1-0.dll
GCBase_MD_VC141_v3_4.dll
GenApi_MD_VC141_v3_4.dll
KERNEL32.dll
MSVCP140.dll
python310.dll
VCRUNTIME140.dll
...

When tying to load the module I've got the error

Traceback (most recent call last):
  File "M:\Software\GUI\main.py", line 22, in <module>
    from genicam.genapi import NodeMap
  File "C:\Dev\Python3_11\Lib\site-packages\genicam\genapi.py", line 44, in <module>
    from . import _genapi
ImportError: DLL load failed while importing _genapi: Das angegebene Modul wurde nicht gefunden.

Process finished with exit code 1

Even when I try to cheat and copy the python310.dll into the package folder I've got a version mismatch error.

@MathijsNL
Copy link

I see you are trying to get it working under Windows. I used Linux to test and it worked without any errors.

Is there a specific reason you need this to work on Python 3.11?

@kazunarikudo
Copy link
Member

Hi guys, Python 3.11 will be supported by the next release in early 2023; we as the committee are working on it now, and the ARM64 binary should be bundled with it. By the way, I do not mind if you play the altered binaries but I would never bring up such an untrusty entity into the business. So scary. ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants