Python Forum
Controling a Canon dslr camera on Windows
Thread Rating:
  • 1 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Controling a Canon dslr camera on Windows
#1
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.
Reply
#2
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
Reply
#3
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\
Reply
#4
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
Reply
#5
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\
Reply
#6
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
Reply
#7
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 ?
Reply
#8
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.
Reply
#9
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.
Reply
#10
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
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Get image from PI camera and analyze it korenron 0 1,167 Apr-28-2022, 06:49 AM
Last Post: korenron
  Create RTSP stream from camera? korenron 1 3,267 Jan-04-2022, 10:38 AM
Last Post: Larz60+
  How to get OpenCV to display entire camera frame? George713 1 3,270 Aug-12-2021, 02:45 AM
Last Post: Pedroski55
  Wifi Camera Connection MeenAg 2 3,118 Oct-02-2020, 06:35 PM
Last Post: MeenAg
  mapping-camera-coordinates-to-a-2d-floor-plan fauveboyxuuki 0 2,543 Dec-10-2019, 10:34 PM
Last Post: fauveboyxuuki
  New to Python, help with saving image from camera tantony 2 3,864 Sep-13-2019, 05:19 PM
Last Post: tantony
  pi camera stream is upside down delta1071 3 5,759 Sep-11-2019, 11:35 AM
Last Post: metulburr
  Camera animation to Text file (CINEMA 4D) vbz 0 2,315 Aug-13-2019, 07:39 AM
Last Post: vbz
  How to extract temperature value of pixels of a thermal image recorded by IR camera hamacvan 1 14,464 Jan-13-2019, 06:06 PM
Last Post: Larz60+
  Camera Image Data annakin4 0 2,662 Jan-24-2018, 05:50 PM
Last Post: annakin4

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020