Python Forum

Full Version: Controling a Canon dslr camera on Windows
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I'm looking for a simple way to control a Canon dslr camera on Windows with Python.
I need to control the shutter and import the last picture.

I tried to use Gphoto2 only this is based on Rassberry pie , and i need to use Windows.
Quote:Gphoto2 only this is based on Rassberry pie
I don't see any dependency on raspberry pi at all.
see the simple test here: https://github.com/jim-easterbrook/pytho...o2#testing
It's python, should run on any platform or computer with camera connected.
Take a serious look at the readme page here: https://github.com/jim-easterbrook/pytho...README.rst
Strange…
When i'm trying to install gphoto2 i get this error:

Command "python setup.py egg_info" failed with error code 1 in C:\Users\Leond\AppData\Local\Temp\pip-install-209zkcs9\gphoto2\
how are you trying to install (please show all steps)
what version of python are you using?
OS version?

According to the docs, should be ok with:
Quote:Operating System
MacOS
MacOS :: MacOS X
POSIX
POSIX :: BSD :: FreeBSD
POSIX :: BSD :: NetBSD
POSIX :: Linux
Programming Language
Python :: 2
Python :: 2.6
Python :: 2.7
Python :: 3

should be able to install simply using:
pip install gphoto2
I'm running Windows 10 with Python 3
Normally i've got no problem with pip only with gphoto2 it won't work.


C:\Users\Leond>pip install gphoto2
Collecting gphoto2
Using cached https://files.pythonhosted.org/packages/...9.0.tar.gz
Complete output from command python setup.py egg_info:
ERROR: command "pkg-config --modversion libgphoto2" failed
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Leond\AppData\Local\Temp\pip-install-pwzhb_09\gphoto2\setup.py", line 38, in <module>
cmd, stderr=FNULL, universal_newlines=True).split('.')
File "c:\users\leond\appdata\local\programs\python\python36\lib\subprocess.py", line 336, in check_output
**kwargs).stdout
File "c:\users\leond\appdata\local\programs\python\python36\lib\subprocess.py", line 403, in run
with Popen(*popenargs, **kwargs) as process:
File "c:\users\leond\appdata\local\programs\python\python36\lib\subprocess.py", line 709, in __init__
restore_signals, start_new_session)
File "c:\users\leond\appdata\local\programs\python\python36\lib\subprocess.py", line 997, in _execute_child
startupinfo)
FileNotFoundError: [WinError 2] Het systeem kan het opgegeven bestand niet vinden

----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\Leond\AppData\Local\Temp\pip-install-pwzhb_09\gphoto2\
see which python pip is linked to, type from command line:
pip -V
(uppercase V) and see what you get, you should see python version used by pip
Output:
pip 18.1 from /home/larz60/.pyenv/versions/3.7.1/lib/python3.7/site-packages/pip (python 3.7)
If you don't see python 3, try:
pip3 -V
If now you do, finally try:
pip3 install gphoto2
This is what i read from the manual:

Dudes, Windows is the way to go. How do I compile gphoto2 for that environment?

We don't have the money to buy Windows and something like Visual C. Therefore, we can't provide you a gphoto2 for Windows. You have two choices (at least):

So are there other options ?
Quote: Windows is the way to go
Been at this 50 years, when windows can do everything that 'Unix' used to do back in the 1980's I might switch,
but then will have to compare to modern Linux.

I actually did switch for about a year and a half (had to do some development work for windows), but was happy to be back on Linux.

Windows is OK, but sorry, in my humble opinion, not the way to go!
Also please note that most packages are not written by python-forum moderators and admins, but by individuals.
Most are cross platform, and also most developers strive for this, but not always the case.

finally you should be able to contact the author through github he may have windows version in the works.
def Call(code):
	if code!=0:
            raise EDSDKError,EDErrorMsg(code)
Iám trying something else, a edsdk wrapper for the official Canon SDK.

Only i get a invalid syntax on this line.
Quote:Only i get a invalid syntax on this line.
There are 3 lines, assume it's on the raise?
Also, show enough code to run.
What are you importing?
Please always post error tracebacks unmodified and complete as they contain very valuable information
Pages: 1 2