[英]Impossible to install py3exiv2 with 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
我在带有 Python 3.5 的 Mac 和带有 virtualenv 和 Python 3.4 的 Ubuntu 上尝试了类似的错误。
我是否忘记手动安装一些依赖项? 包不是用最新的 Python 版本维护的吗?
谢谢。
尝试
sudo apt-get install build-essential python-all-dev libexiv2-dev libboost-python-dev
进而
pip3 install py3exiv2
应该没问题...这些是py3exiv2的构建依赖项...
Pawel 问我如何在 AWS EC2 Linux2 发行版的 centOS 上构建 py3exiv2。 我从“Team Exiv”那里得到了很多帮助,一些成员也在“openhub.com”上找到了。 我附上了我开发的粗略的运行手册。 您显然需要选择较新的库。
请记住,这里有粗略的笔记,而不是详细且高度完善的手册。 另外,我至少有 12 个月没有测试过它。 想想这些步骤在做什么,如果它不起作用,请检查库 doco 的语法。
这是建立在 VirtualBox 环境上的,该环境仅与 VM 设置相关
如果我的记忆是正确的(?CentOS-7-x86_64-DVD-1708.iso?),早期的测试是在 Centos 7.4 上进行的。 除了 Linux2 用户数据和元数据之外,Centos 构建与 AWS Linux2 发行版构建基本相同。
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
\\
是的,这是一个挑战。 我能够在 centOS 和 AWS EC2 Linux2 发行版上“构建”py3exiv2。 然而,我在 MacOS 上还没有成功,但发现在 VirtualBox 上使用共享驱动器安装非常有效。
如果您对运行表进行构建感兴趣,请告诉我,我将对其进行清理并将其张贴在这里。
电阻
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.