gpt4 book ai didi

python - pyexiv2 未找到但已在 Mac OSX El Capitan 上使用 Homebrew 软件安装

转载 作者:太空宇宙 更新时间:2023-11-04 05:20:55 26 4
gpt4 key购买 nike

我已经使用 Homebrew 软件在 OSX El Capitan 上安装了 pyexiv2,但是在尝试使用它时,找不到它。

$ brew install pyexiv2
Warning: pyexiv2-0.3.2_1 already installed

$ python mapillary_tools-master/python/geotag_from_gpx.py photos file.gpx
Traceback (most recent call last):
File "/Users/nighto/Downloads/mapillary_tools-master/python/geotag_from_gpx.py", line 6, in <module>
import pyexiv2
ImportError: No module named pyexiv2

最佳答案

事实证明,当安装 pyexiv2 时,brew 有一个我错过的相当重要的输出:

==> Caveats
Python modules have been installed and Homebrew's site-packages is not
in your Python sys.path, so you will not be able to import the modules
this formula installed. If you plan to develop with these modules,
please run:
mkdir -p /Users/YOUR_USER/Library/Python/2.7/lib/python/site-packages
echo 'import site; site.addsitedir("/usr/local/lib/python2.7/site-packages")' >> /Users/YOUR_USER/Library/Python/2.7/lib/python/site-packages/homebrew.pth

因此,您只需运行这两个命令即可正常工作。

关于python - pyexiv2 未找到但已在 Mac OSX El Capitan 上使用 Homebrew 软件安装,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40358813/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com