繁体   English   中英

在 macOS 问题上安装 py3exiv2

[英]Installing py3exiv2 on macOS issues

我想校准相机镜头,为此,我按照此处的说明进行操作。 根据说明,我需要来自此处的 python3-exiv2 依赖项。

当我尝试运行它时:

pip3 install py3exiv2

我明白了:

Collecting py3exiv2
  Using cached https://files.pythonhosted.org/packages/39/0d/e3a63593c620c4a2999809aa011aa6f190553b20fd6904f7a11946dde722/py3exiv2-0.6.1.tar.gz
Building wheels for collected packages: py3exiv2
  Building wheel for py3exiv2 (setup.py) ... error
  Complete output from command /usr/local/opt/python/bin/python3.7 -u -c "import setuptools, tokenize;__file__='/private/var/folders/mn/_vm4d7cx4gx2_l5hkjybzkfc0000gn/T/pip-install-zeuz9z_9/py3exiv2/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /private/var/folders/mn/_vm4d7cx4gx2_l5hkjybzkfc0000gn/T/pip-wheel-1l2_8rw6 --python-tag cp37:
  find: /usr//sbin/authserver: Permission denied
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.macosx-10.14-x86_64-3.7
  creating build/lib.macosx-10.14-x86_64-3.7/pyexiv2
  copying src/pyexiv2/preview.py -> build/lib.macosx-10.14-x86_64-3.7/pyexiv2
  copying src/pyexiv2/iptc.py -> build/lib.macosx-10.14-x86_64-3.7/pyexiv2
  copying src/pyexiv2/metadata.py -> build/lib.macosx-10.14-x86_64-3.7/pyexiv2
  copying src/pyexiv2/__init__.py -> build/lib.macosx-10.14-x86_64-3.7/pyexiv2
  copying src/pyexiv2/xmp.py -> build/lib.macosx-10.14-x86_64-3.7/pyexiv2
  copying src/pyexiv2/exif.py -> build/lib.macosx-10.14-x86_64-3.7/pyexiv2
  copying src/pyexiv2/utils.py -> build/lib.macosx-10.14-x86_64-3.7/pyexiv2
  running build_ext
  building 'libexiv2python' extension
  creating build/temp.macosx-10.14-x86_64-3.7
  creating build/temp.macosx-10.14-x86_64-3.7/src
  clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.7.2_2/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c src/exiv2wrapper.cpp -o build/temp.macosx-10.14-x86_64-3.7/src/exiv2wrapper.o -g
  In file included from src/exiv2wrapper.cpp:27:
  src/exiv2wrapper.hpp:35:10: fatal error: 'boost/python.hpp' file not found
  #include "boost/python.hpp"
           ^~~~~~~~~~~~~~~~~~
  1 error generated.
  error: command 'clang' failed with exit status 1

  ----------------------------------------
  Failed building wheel for py3exiv2
  Running setup.py clean for py3exiv2
Failed to build py3exiv2
Installing collected packages: py3exiv2
  Running setup.py install for py3exiv2 ... error
    Complete output from command /usr/local/opt/python/bin/python3.7 -u -c "import setuptools, tokenize;__file__='/private/var/folders/mn/_vm4d7cx4gx2_l5hkjybzkfc0000gn/T/pip-install-zeuz9z_9/py3exiv2/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/mn/_vm4d7cx4gx2_l5hkjybzkfc0000gn/T/pip-record-mo9lifhv/install-record.txt --single-version-externally-managed --compile:
    find: /usr//sbin/authserver: Permission denied
    running install
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.14-x86_64-3.7
    creating build/lib.macosx-10.14-x86_64-3.7/pyexiv2
    copying src/pyexiv2/preview.py -> build/lib.macosx-10.14-x86_64-3.7/pyexiv2
    copying src/pyexiv2/iptc.py -> build/lib.macosx-10.14-x86_64-3.7/pyexiv2
    copying src/pyexiv2/metadata.py -> build/lib.macosx-10.14-x86_64-3.7/pyexiv2
    copying src/pyexiv2/__init__.py -> build/lib.macosx-10.14-x86_64-3.7/pyexiv2
    copying src/pyexiv2/xmp.py -> build/lib.macosx-10.14-x86_64-3.7/pyexiv2
    copying src/pyexiv2/exif.py -> build/lib.macosx-10.14-x86_64-3.7/pyexiv2
    copying src/pyexiv2/utils.py -> build/lib.macosx-10.14-x86_64-3.7/pyexiv2
    running build_ext
    building 'libexiv2python' extension
    creating build/temp.macosx-10.14-x86_64-3.7
    creating build/temp.macosx-10.14-x86_64-3.7/src
    clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.7.2_2/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c src/exiv2wrapper.cpp -o build/temp.macosx-10.14-x86_64-3.7/src/exiv2wrapper.o -g
    In file included from src/exiv2wrapper.cpp:27:
    src/exiv2wrapper.hpp:35:10: fatal error: 'boost/python.hpp' file not found
    #include "boost/python.hpp"
             ^~~~~~~~~~~~~~~~~~
    1 error generated.
    error: command 'clang' failed with exit status 1

    ----------------------------------------
Command "/usr/local/opt/python/bin/python3.7 -u -c "import setuptools, tokenize;__file__='/private/var/folders/mn/_vm4d7cx4gx2_l5hkjybzkfc0000gn/T/pip-install-zeuz9z_9/py3exiv2/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/mn/_vm4d7cx4gx2_l5hkjybzkfc0000gn/T/pip-record-mo9lifhv/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/mn/_vm4d7cx4gx2_l5hkjybzkfc0000gn/T/pip-install-zeuz9z_9/py3exiv2/

我不知道从哪里开始这个输出。 谁能建议我此时可以尝试什么?

运行以下内容没有帮助:

brew boost-python

您面临的问题是因为在 MacOS 新版本上,pip3 没有在正确的位置查找头文件。 在这里查看我的答案: https ://answers.launchpad.net/py3exiv2/+question/700064

这就是为我解决的问题:

要解决此问题,请执行以下操作:

brew install boost-python3 gexiv2 pygobject3

安装依赖项后,您将面临更多错误。 要解决这些问题,请设置正确的包含和链接器路径,然后使用 pip 安装模块。

export CPLUS_INCLUDE_PATH=/usr/local/Cellar/exiv2/0.27.5_1/include/:/usr/local/opt/libssh/include/:/usr/local/Cellar/boost/1.76.0/include/
export LDFLAGS="-L/usr/local/Cellar/boost-python3/1.76.0/lib -L/usr/local/Cellar/exiv2/0.27.5_1/lib"

 pip install py3exiv2

或者如果您使用的是 pipenv


 CPLUS_INCLUDE_PATH=/usr/local/Cellar/exiv2/0.27.5_1/include/:/usr/local/opt/libssh/include/:/usr/local/Cellar/boost/1.76.0/include/ LDFLAGS="-L/usr/local/Cellar/boost-python3/1.76.0/lib -L/usr/local/Cellar/exiv2/0.27.5_1/lib" pipenv install

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM