在 CentOS 上安装 python 模块 pyexiv2?

在 CentOS 上安装 python 模块 pyexiv2?

我下载了最新的 pyexiv2 文件:pyexiv2-0.3.2.tar.bz2,我查看了 README 文件,其中写着:

To build and install the library, while in the top-level directory
(e.g. '~/dev/pyexiv2', which should contain a file named 'SConstruct'),
run the following commands:

 $ scons
 $ scons install # as administrator, e.g. `sudo scons install`

The result of the build is a dynamic library, libexiv2python.so, in the build/
directory. This is the low-level binding. It is in turn used in a higher level
module, pyexiv2.
The install command installs the two modules in your site-specific directory for
Python modules (e.g. '/usr/lib/python2.7/dist-packages/' on Linux).

我正是这么做的su(现在以 root 身份运行)

cp -r 'pyexiv2-0.3.2' ~

然后跑:scons

它说:

scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
o build/exiv2wrapper.os -c -fPIC -I/usr/include/python2.6 src/exiv2wrapper.cpp
sh: o: command not found
o build/exiv2wrapper_python.os -c -fPIC -I/usr/include/python2.6 src/exiv2wrapper_python.cpp
sh: o: command not found
o build/libexiv2python.so -shared build/exiv2wrapper.os build/exiv2wrapper_python.os -lboost_python -lexiv2
sh: o: command not found
scons: done building targets.

有什么想法从这里去哪里吗?

答案1

你的 scons 安装中有问题或者你没有安装 g++。 scons 的报告来自同一来源:

g++ -o build/exiv2wrapper.os -c -fPIC -I/usr/include/python2.7 src/exiv2wrapper.cpp

为我。我会看看/usr/lib/scons/SCons/Tool/g++.py或者只是尝试一下

$ g++ --version

看看错误在哪里。如果未安装 g++,请安装它。如果 scons 支持文件损坏,重新安装可能比调试更容易。

相关内容