Closed FilipDominec closed 1 month ago
The python bindings provide wheels with pre-built binaries, but I am not sure if they are built for windows.
@jim-easterbrook ?
Sorry for the delayed reply, I've been away for a few days.
No, I don't provide pre-built binaries for Windows. As I understand it, libgphoto2 can only be built on Windows using MSYS2/MinGW. My only Windows installation is Windows 7 and MSYS2 is no longer supported.
Things are further complicated by building for "native" MSYS2 or trying to create a Python binary compatible with the standard Windows Python (which uses the MSVC compiler suite). I'm not sufficiently expert at Windows or MSYS2 to know how best to do this, and I don't have a test environment to do it in.
MSYS2 provide several builds of libgphoto2: https://packages.msys2.org/search?t=binpkg&q=gphoto2 The base package https://packages.msys2.org/base/mingw-w64-libgphoto2 should be usable with python-gphoto2 if you do a non-binary install. This compiles the python-gphoto2 interface to link with the "system" installed libgphoto2. It's a long time since I tried this though.
Thank you both for your comments.
If you personally needed to run one particular type of camera from Windows, would you consider sniffing the Linux-libgphoto-camera communication and rewriting the data rx/tx using libusb? Do you think there is some serious reason not to try it?
you would need to reimplement parts of libgphoto2. so it would make more sense to try building libgphoto2 itself and python bindings with MSYS2 or so
Thank you for your responses, one day we might try recompiling for Windows.
So far we are 99% happy with running python-gphoto
under Ubuntu in VMware.
@FilipDominec why not try WSL instead of VMWare?
We are somewhat busy and have not experience with WSL, but we will give it a try one day. Thanks.
In our optical laboratory, I use an old Canon 350D to take tethered photos, as a part of an experiment that is controlled by a Python script.
It already works great on Linux, but now we need to run the script also on Windows 10. And then it goes complicated. While there are reports (https://github.com/gphoto/libgphoto2/issues/279) on libgphoto2 already being built on Windows, we found no easy way to give it a try.
Therefore I would be very thankful to all developers or experienced users for an advice:
import gphoto2
on Windows,camlibs/canon.c
and try building a cross-platform module that communicates with my specific camera using pyUSB backend? (Actually at least one similar project exists: https://pypi.org/project/canon-remote/)I also suggest the documentation could clarify the topic of "libgphoto and Windows" for other users - apparently I am not the first one solving this problem. Thanks a lot!