jim-easterbrook / python-gphoto2

Python interface to libgphoto2
GNU Lesser General Public License v3.0
362 stars 59 forks source link

Installation issues - can't find libgphoto2.pc #33

Closed astronerdnj closed 7 years ago

astronerdnj commented 7 years ago

Hi,

I am trying to installing python-gphoto2 on an Ubuntu 16.04LTS system. I have previously installed gphoto2 v 2.5.9 via apt-get and it is working fine. When setup.py runs it complains that it cannot find libgphoto2.pc and terminates with multiple errors (abbreviated output from a pip3 installation is below - errors are at the end). I can find libgphoto2.pc nowhere on my machine - it looks like apt-get did not install it.

I am relatively new to this so apologies if this is a simplistic question - how do I fix this? I have found other users with the same issue elsewhere on the web with the same issue but no solution. Within the tar file for libgphoto2 there is a libgphoto2.pc.in file. Can I just rename it, put it in the same directory as other .pc files, add that directory to the PKG_CONFIG_PATH environment variable and it should work?

Thanks,

Gavin

gavin@gavin-ThinkPad-T430u:~$ sudo -H pip3 install -v gphoto2 Collecting gphoto2 1 location(s) to search for versions of gphoto2:

REMOVED MANY OF THE FOUND LINKS FOR BREVITY

https://pypi.python.org/packages/ff/6f/0292c9e794aa25d54ca565c459daaafe7f886cfc35cfd18739bb8b32c07a/gphoto2-1.4.0.zip#md5=7fc27c46e8acf623453da90ca32e8892 (from https://pypi.python.org/simple/gphoto2/), version: 1.4.0 Using version 1.7.0 (newest of versions: 0.3.2, 0.3.3, 0.4.0, 0.5.0, 0.5.1, 0.5.2, 0.6.0, 0.7.0, 0.7.1, 0.8.0, 0.9.0, 0.9.1, 0.10.0, 0.10.1, 0.10.2, 0.11.0, 0.11.1, 0.11.2, 1.0.0, 1.1.0, 1.2.0, 1.2.1, 1.2.2, 1.3.1, 1.3.2, 1.3.3, 1.3.4, 1.4.0, 1.4.1, 1.5.0, 1.5.1, 1.6.0, 1.7.0) Looking up "https://pypi.python.org/packages/d9/05/de56a7266fc5b61c38a3aa5caa03a71dcd9c23d827b4638b96912d4511fb/gphoto2-1.7.0.tar.gz" in the cache No cache entry available "GET /packages/d9/05/de56a7266fc5b61c38a3aa5caa03a71dcd9c23d827b4638b96912d4511fb/gphoto2-1.7.0.tar.gz HTTP/1.1" 200 6831640 Downloading gphoto2-1.7.0.tar.gz (6.8MB) Downloading from URL https://pypi.python.org/packages/d9/05/de56a7266fc5b61c38a3aa5caa03a71dcd9c23d827b4638b96912d4511fb/gphoto2-1.7.0.tar.gz#md5=4874826d5f6e36d526686344735a8555 (from https://pypi.python.org/simple/gphoto2/) 99% |████████████████████████████████| 6.8MB 9.4MB/s eta 0:00:01 Updating cache with response from "https://pypi.python.org/packages/d9/05/de56a7266fc5b61c38a3aa5caa03a71dcd9c23d827b4638b96912d4511fb/gphoto2-1.7.0.tar.gz" Caching due to etag 100% |████████████████████████████████| 6.8MB 202kB/s Running setup.py (path:/tmp/pip-build-gtemulbk/gphoto2/setup.py) egg_info for package gphoto2 Running command python setup.py egg_info Package libgphoto2 was not found in the pkg-config search path. Perhaps you should add the directory containing `libgphoto2.pc' to the PKG_CONFIG_PATH environment variable No package 'libgphoto2' found Traceback (most recent call last): File "", line 1, in File "/tmp/pip-build-gtemulbk/gphoto2/setup.py", line 37, in cmd, universal_newlines=True).split('.') File "/usr/lib/python3.5/subprocess.py", line 626, in check_output kwargs).stdout File "/usr/lib/python3.5/subprocess.py", line 708, in run output=stdout, stderr=stderr) subprocess.CalledProcessError: Command '['pkg-config', '--modversion', 'libgphoto2']' returned non-zero exit status 1 Cleaning up... Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-gtemulbk/gphoto2/ Exception information: Traceback (most recent call last): File "/usr/local/lib/python3.5/dist-packages/pip/basecommand.py", line 215, in main status = self.run(options, args) File "/usr/local/lib/python3.5/dist-packages/pip/commands/install.py", line 335, in run wb.build(autobuilding=True) File "/usr/local/lib/python3.5/dist-packages/pip/wheel.py", line 749, in build self.requirement_set.prepare_files(self.finder) File "/usr/local/lib/python3.5/dist-packages/pip/req/req_set.py", line 380, in prepare_files ignore_dependencies=self.ignore_dependencies)) File "/usr/local/lib/python3.5/dist-packages/pip/req/req_set.py", line 634, in _prepare_file abstract_dist.prep_for_dist() File "/usr/local/lib/python3.5/dist-packages/pip/req/req_set.py", line 129, in prep_for_dist self.req_to_install.run_egg_info() File "/usr/local/lib/python3.5/dist-packages/pip/req/req_install.py", line 439, in run_egg_info command_desc='python setup.py egg_info') File "/usr/local/lib/python3.5/dist-packages/pip/utils/init.py", line 707, in call_subprocess % (command_desc, proc.returncode, cwd)) pip.exceptions.InstallationError: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-gtemulbk/gphoto2/ Looking up "https://pypi.python.org/pypi/pip/json" in the cache No cache entry available Starting new HTTPS connection (1): pypi.python.org "GET /pypi/pip/json HTTP/1.1" 200 72983 Updating cache with response from "https://pypi.python.org/pypi/pip/json" Caching b/c date exists and max-age > 0

jim-easterbrook commented 7 years ago

The command that failed during installation is pkg-config --modversion libgphoto2 - this is usually because the "development headers" version of libgphoto2 hasn't been installed. Try sudo apt-get install libgphoto2-dev before installing python-gphoto2.

astronerdnj commented 7 years ago

Thank you Jim - that fixed it!

jim-easterbrook commented 7 years ago

I've edited the README and stopped setup.py giving messages about libgphoto2.pc so I hope fewer people will have this problem in future.