我已经在OSX上安装了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发布于 2016-11-01 11:05:27
结果发现,在安装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因此,您只需运行这两个命令,它就能正常工作。
https://stackoverflow.com/questions/40358813
复制相似问题