Comments (13)
Thanks for the bug report.
I've not tried building on an Ubuntu machine, but I suspect you haven't installed the libgphoto2 "development" package that should install header files in /usr/include/gphoto2. Or maybe it's installed them somewhere else and SWIG isn't finding them.
from python-gphoto2.
You're absolutely correct. Somehow I thought that was what I had gotten from the SVN. A simple sudo apt-get install libgphoto2-2-dev was all I needed.
from python-gphoto2.
I should add a note to the README though. It's not clear that 'dev' versions are needed.
from python-gphoto2.
I might have spoken too soon
benoit@ubuntu:~/dev/python-gphoto2$ python
Python 2.7.6 (default, Mar 22 2014, 22:59:56)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
import gphoto2
Traceback (most recent call last):
File "", line 1, in
File "gphoto2/init.py", line 1, in
from .gphoto2_abilities_list import *
File "gphoto2/gphoto2_abilities_list.py", line 9, in
import gphoto2_context
File "gphoto2/gphoto2_context.py", line 28, in
_gphoto2_context = swig_import_helper()
File "gphoto2/gphoto2_context.py", line 20, in swig_import_helper
import _gphoto2_context
ImportError: No module named _gphoto2_context
from python-gphoto2.
Make sure you run 'python setup.py build' twice before running 'sudo python setup.py install'.
from python-gphoto2.
Ignore that. Make sure you change to a different directory before starting python and importing gphoto2. Otherwise it attempts to use the source directory, which has the python wrappers but not the compiled extensions.
from python-gphoto2.
Roflcopters, I should have known that!
from python-gphoto2.
It catches me out as well. Am about to move the sources to a 'source' directory.
from python-gphoto2.
Probably a good idea!
Thanks for all your help, this might be much more fun than calling gphoto2 in subprocesses!
from python-gphoto2.
Obiben, how are you getting on with python-gphoto2? (I would ask in a private message, but there doesn't appear to be such a facility on GitHub.) I'd be pleased to hear any feedback, good or bad.
from python-gphoto2.
Frankly I just didn't so far. Before I reported this I've made significant progress just using the gphoto2 command line and subprocess module. I resolved to use the bindings whenever the command line would fail me - which didn't happen.
Just from seeing the examples tho, I'm thinking it'd be awesome to have some kind of wrapper class to remove the need to call check_result and pass context every function call!
from python-gphoto2.
I can see the appeal of that, but it would be difficult to make an automatically generated wrapper do that given the not totally consistent C API. I didn't want to wrap every method individually as there's a lot of them and I'd be forever tracking changes and making the wrapper a lot more sensitive to the library version.
I've got a few ideas I could try though.
from python-gphoto2.
Commit 8b4cb45 adds some helper classes.
from python-gphoto2.
Related Issues (20)
- Missing pre-req's(?) after building libgphoto2 from source on Raspberry Pi HOT 3
- Can not set datetime on Canon EOS 1200D HOT 4
- equivalent of gphoto2 --reset HOT 1
- delete a file HOT 2
- gp_camera_get_single_config HOT 2
- Socket error after gp_camera_exit in windows/msys2 HOT 15
- Faster way to copy files from camera HOT 7
- Sony FX3 overshoot HOT 1
- `delete_file()` does not delete file HOT 9
- Segmentation Fault segfault on gp.Camera.autodetect() on Github Actions Runner HOT 21
- LGPL vs. GPL license? HOT 8
- Test Virtual Camera HOT 4
- Missing bindings for gp_port_new, gp_port_open, and gp_port_reset? HOT 2
- capture_preview() broken in v2.5.0 HOT 4
- having trouble getting gphoto2 on rpi HOT 3
- use python-gphoto2 in Windows system HOT 1
- Always connected capture anytime HOT 1
- Github Actions Python 3.12 environment. HOT 1
- Is live data acquisition available in the library? HOT 1
- Error When Installing with "Local" libgphoto2 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-gphoto2.