无法通过pip安装py3exiv2?

Dav*_* D. 5 python pip

运行时pip install py3exiv2,出现此错误:

Collecting py3exiv2
  Downloading py3exiv2-0.2.1.tar.gz
Installing collected packages: py3exiv2
  Running setup.py install for py3exiv2 ... error
    Complete output from command /home/vagrant/venv/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-j6a3aby9/py3exiv2/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-ppz_a46j-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/vagrant/venv/include/site/python3.4/py3exiv2:
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.4
    creating build/lib.linux-x86_64-3.4/pyexiv2
    copying src/pyexiv2/iptc.py -> build/lib.linux-x86_64-3.4/pyexiv2
    copying src/pyexiv2/exif.py -> build/lib.linux-x86_64-3.4/pyexiv2
    copying src/pyexiv2/xmp.py -> build/lib.linux-x86_64-3.4/pyexiv2
    copying src/pyexiv2/preview.py -> build/lib.linux-x86_64-3.4/pyexiv2
    copying src/pyexiv2/__init__.py -> build/lib.linux-x86_64-3.4/pyexiv2
    copying src/pyexiv2/utils.py -> build/lib.linux-x86_64-3.4/pyexiv2
    copying src/pyexiv2/metadata.py -> build/lib.linux-x86_64-3.4/pyexiv2
    running build_ext
    building 'libexiv2python' extension
    creating build/temp.linux-x86_64-3.4
    creating build/temp.linux-x86_64-3.4/src
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -I/home/vagrant/venv/include -I/usr/include/python3.4m -c src/exiv2wrapper.cpp -o build/temp.linux-x86_64-3.4/src/exiv2wrapper.o -g
    cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ [enabled by default]
    In file included from src/exiv2wrapper.cpp:27:0:
    src/exiv2wrapper.hpp:32:27: fatal error: exiv2/image.hpp: No such file or directory
     #include "exiv2/image.hpp"
                               ^
    compilation terminated.
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
Run Code Online (Sandbox Code Playgroud)

我在Mac上使用Python 3.5尝试过,在Ubuntu上使用virtualenv和Python 3.4尝试过类似的错误。

我忘了手动安装一些依赖项吗?软件包不使用最新的Python版本维护吗?

谢谢。

Dan*_*uer 8

尝试

sudo apt-get install build-essential
sudo apt-get install python-all-dev
sudo apt-get install libexiv2-dev
sudo apt-get install libboost-python-dev
Run Code Online (Sandbox Code Playgroud)

然后

pip3 install py3exiv2
Run Code Online (Sandbox Code Playgroud)

应该没关系...这些是py3exiv2的构建依赖项...


Pol*_*ath 0

是的,这是一个挑战。我能够在 centOS 和 AWS EC2 Linux2 发行版上“构建”py3exiv2。然而,我在 MacOS 上还没有取得成功,但发现使用共享驱动器安装在 VirtualBox 上工作非常有效。

如果您对构建的运行表感兴趣,请告诉我,我会将其清理并发布在这里。