Coder Social home page Coder Social logo

Build failed about python-gphoto2 HOT 13 CLOSED

jim-easterbrook avatar jim-easterbrook commented on July 23, 2024
Build failed

from python-gphoto2.

Comments (13)

jim-easterbrook avatar jim-easterbrook commented on July 23, 2024

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.

obiben avatar obiben commented on July 23, 2024

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.

jim-easterbrook avatar jim-easterbrook commented on July 23, 2024

I should add a note to the README though. It's not clear that 'dev' versions are needed.

from python-gphoto2.

obiben avatar obiben commented on July 23, 2024

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.

jim-easterbrook avatar jim-easterbrook commented on July 23, 2024

Make sure you run 'python setup.py build' twice before running 'sudo python setup.py install'.

from python-gphoto2.

jim-easterbrook avatar jim-easterbrook commented on July 23, 2024

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.

obiben avatar obiben commented on July 23, 2024

Roflcopters, I should have known that!

from python-gphoto2.

jim-easterbrook avatar jim-easterbrook commented on July 23, 2024

It catches me out as well. Am about to move the sources to a 'source' directory.

from python-gphoto2.

obiben avatar obiben commented on July 23, 2024

Probably a good idea!

Thanks for all your help, this might be much more fun than calling gphoto2 in subprocesses!

from python-gphoto2.

jim-easterbrook avatar jim-easterbrook commented on July 23, 2024

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.

obiben avatar obiben commented on July 23, 2024

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.

jim-easterbrook avatar jim-easterbrook commented on July 23, 2024

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.

jim-easterbrook avatar jim-easterbrook commented on July 23, 2024

Commit 8b4cb45 adds some helper classes.

from python-gphoto2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.