When running pip install py3exiv2
, I got this error:
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
I tried on a mac with Python 3.5, and on Ubuntu with virtualenv and Python 3.4, similar error.
Did I forget to install some dependency manually? Is the package not maintained with newest Python version?
Thanks.
Try to
sudo apt-get install build-essential python-all-dev libexiv2-dev libboost-python-dev
And then
pip3 install py3exiv2
It should be ok... Those are build dependencies for py3exiv2...
Pawel, asked how I built py3exiv2 on centOS on the AWS EC2 Linux2 distro. I had a lot of help from the 'Team Exiv' with some members also found on 'openhub.com'. I have attached the crude run-book I developed. You will obviously need to select newer libraries.
Please keep in mind that there are crude notes, not a detailed and highly polished manual. Plus I have not tested it in at least 12 months. Think about what what the steps are doing and if it doesn't work check syntax against the library doco.
This was built on a VirtualBox environment which is only relevant with regard to the VM setup
Earlier tests were on Centos 7.4 if my recollection is correct (?CentOS-7-x86_64-DVD-1708.iso?). The Centos build was basically identical to AWS Linux2 distro build except with regard to the Linux2 user-data and metadata.
Need to set user-data & meta-data to prep the Linux2 distro. (see AWS doco)
VirtualBox nic to Bridge and active nic
storage to use new seed.iso
update /etc/ssh/sshd_config
PermitRootLogin yes
and
PasswordAuthentication yes
#PasswordAuthentication no
Check disk space needed !! need about 4GB
Add & mount another vol if needed
~~~~~~~~~~~~~
If using Virtual Box you can set up folder / directory sharing as follows
https://www.if-not-true-then-false.com/2010/install-virtualbox-guest-additions-on-fedora-centos-red-hat-rhel/
For AWS Linux2 (Q1 2018) It found that the CentOS7 process worked perfectly. (watch the wrong form quote marks)
https://gist.github.com/larsar/1687725
~~~~~~~~~~~~~
http://dev.exiv2.org/projects/exiv2/wiki/How_do_I_build_Exiv2_on_the_XYZ_platform
write to log as well as screen
some_command | tee log.txt
| tee ~/mk4b-#.log
1) Install Development Tools on CentOS
Update the system and install the development tools
(https://www.digitalocean.com/community/tutorials/how-to-install-python-3-and-set-up-a-local-programming-environment-on-centos-7)
sudo yum -y update
sudo yum -y install yum-utils
sudo yum -y groupinstall development
2) Build and test exiv2
2.a) Install dependent libraries:
sudo yum -y install expat-devel
sudo yum -y install zlib-devel
sudo yum -y install openssl-devel
2.b) Install tools required for the Exiv2 test suite
sudo yum -y install subversion
sudo yum -y install dos2unix
2.c) Get the code
http://www.exiv2.org/download.html
2.d) Install the code into the build tree
mkdir -p ~/gnu/exiv2
cd ~/gnu/exiv2
~~~~~~~~~~~~~~~~~
curl -O http://www.exiv2.org/builds/exiv2-0.26-trunk.tar.gz
tar xzf exiv2-0.26-trunk.tar.gz
cd exiv2-trunk/
~~~~~~~~~~~~~~~
2.e) Build it
(http://dev.exiv2.org/projects/exiv2/wiki/How_do_I_build_Exiv2_on_the_XYZ_platform)
cd ~/gnu/exiv2/exiv2-trunk
./configure | tee ~/mk7-2e1.log
make | tee ~/mk7-2e2.log
sudo make install | tee ~/mk7-2e3.log
export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:/usr/lib/pkgconfig"
2.f) Run the test suite (optional)
svn export svn://dev.exiv2.org/svn/tags/0.26/test
# you only need to do this once to download the test suite
make samples | tee ~/mk7-2f1.log
make tests | tee ~/mk7-2f2.log
3) Build and install python 3.6.4
3.a) Get the code
https://www.python.org/downloads/
mkdir ~/gnu/python3
cd ~/gnu/python3
wget https://www.python.org/ftp/python/3.6.4/Python-3.6.4.tgz
3.b)
tar xzf Python-3.6.4.tgz
pwd
ls -la
3.c) Built and install python3.6.4
cd ~/gnu/python3/Python-3.6.4
./configure ## ./configure | tee ~/mk7-3c1.log
make #### make | tee ~/mk7-3c2.log
sudo make install ## sudo make install | tee ~/mk7-3c3.log
3.d) Create a link to use python3
which python3
which python3.6
sudo ln -s /usr/local/bin/python3.6 /usr/local/bin/python3
4) Build and install boost
4.a) Get the code from http://www.boost.org/users/download/ (wget)
mkdir ~/gnu/boost
cd ~/gnu/boost
wget https://dl.bintray.com/boostorg/release/1.66.0/source/boost_1_66_0.tar.gz
4.b) extract boost
tar xzf boost_1_66_0.tar.gz
cd ~/gnu/boost/boost_1_66_0
ls -la
4.c)Build and install boost
cd ~/gnu/boost/boost_1_66_0
export BOOST_LIBRARYDIR=$PWD/libs
export BOOST_ROOT=$PWD
export CPLUS_INCLUDE_PATH=/usr/local/include/python3.6m
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib"
./bootstrap.sh --with-python=/usr/local/bin/python3.6 **** check which python 3.6
## ./bootstrap.sh --with-python=/usr/local/bin/python3.6 | tee ~/mk7-4c1.log
./b2 ## ./b2 | tee ~/mk7-4c2.log
sudo $PWD/b2 install ## sudo $PWD/b2 install | tee ~/mk7-4c3.log
5) Build and test py3exiv2
5.a) Get the code from https://pypi.python.org/pypi/py3exiv2/0.1.0
mkdir ~/gnu/py3exiv2
cd ~/gnu/py3exiv2
… copy the source into ~/gnu/py3exiv2/py3exiv2-0.1.0
wget https://pypi.python.org/packages/60/3b/087a0852d41c5e23eda386f9569c8a2d21085421fe623f9fc9ad14e5a0eb/py3exiv2-0.1.0.tar.gz#md5=cbbc08a30dccedea1fef4f3dd4637db1
tar xzf py3exiv2-0.1.0.tar.gz
ls -la
5.b) Build and install py3exiv2
cd ~/gnu/py3exiv2/py3exiv2-0.1.0
ls -la
sudo /usr/local/bin/python3.6 setup.py install
## sudo /usr/local/bin/python3.6 setup.py install | tee ~/mk7-5b1.log
~~~~~~~~~~~~~~~~
5.c) Test py3exiv2
python3.6
import pyexiv2
image=pyexiv2.ImageMetadata('/home/vict/gnu/exiv2/exiv2-trunk/test/data/exiv2-bug876.jpg') # image on your computer
image.read()
image.exif_keys
'/home/vict/gnu/exiv2/exiv2-trunk/test/data/exiv2-bug876.jpg'
/home/vict/gnu/exiv2/exiv2-trunk/test/data/preview/eps-nested_xmp_ai-8-lev3-preview1.tif
/home/vict/gnu/boost/boost_1_66_0/tools/build/doc/images/warning.png
……….. lots and lots of lovely output …………….
6) To run in a “clean shell”
6.a) Set LD_LIBRARY_PATH
consider setting this in your ~/.login or ~/.bashrc or ~/.profile so that it’s “always set"
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib"
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib"
6.b) Run python3
python3
import pyexiv2
help(pyexiv2)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./b2
===
gcc.compile.c++ bin.v2/libs/wave/build/gcc-gnu-4.8.5/release/link-static/threadapi-pthread/threading-multi/cpplexer/re2clex/cpp_re.o
gcc.archive bin.v2/libs/wave/build/gcc-gnu-4.8.5/release/link-static/threadapi-pthread/threading-multi/libboost_wave.a
common.copy stage/lib/libboost_wave.a
...failed updating 54 targets...
...skipped 6 targets...
...updated 1160 targets...
[vict@localhost boost_1_66_0]$
[vict@localhost boost_1_66_0]$ ls -la
total 724
~~~~~~~~~~~~~~~~~~~~~~~~
redo to include OpenSSL - sqlite3
3.c) Built and install python3.6.4
cd ~/gnu/python3/Python-3.6.4
./configure ## ./configure | tee ~/mk7-3c1-c.log
make #### make | tee ~/mk7-3c2-c.log
sudo make install ## sudo make install | tee ~/mk7-3c3-c.log
3.d) Create a link to use python3
which python3
which python3.6
sudo ln -s /usr/local/bin/python3.6 /usr/local/bin/python3
\\
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With