多次安装后图形文件夹模块将不会导入 (Mac OSX)
python gdal 模块的类似问题 Gdal 在几次后不会导入通过修改我的 shell 配置文件以确保找到 MacPorts 安装的端口,然后使用 sudo port select python python27 解决了安装 (Mac OSX) 的问题。
但这一次,我的图形文件夹中处理 tiff 和 png 读写的每个模块都不会导入:
tiff @3.9.5graphics/tiff
pngpp @0.2.3graphics/pngpp
libgeotiff @1.3.0graphics/libgeotiff
再次,当我运行 python 导入任一模块时,我得到类似的响应:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named png
我做错了什么?
A similar problem with the python gdal module Gdal will not import after several installs (Mac OSX) was solved by modifying my shell profile to ensure MacPorts-installed ports are found, and then using sudo port select python python27
.
But this time it's every module in my graphics folder that deals with tiff and png reading and writing that will not import:
tiff @3.9.5 graphics/tiff
pngpp @0.2.3 graphics/pngpp
libgeotiff @1.3.0 graphics/libgeotiff
Again, when I run python to import either module I get the similar response:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named png
What am I doing wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于大多数 Python 包,MacPorts 为每个受支持的 Python 版本提供单独的端口。例如,如果您尝试使用 PIL(Python 成像库),则需要安装该端口的 2.7 版本:
如果您尚未安装,那么还将安装 Python 2.7 的 MacPorts 版本。它位于
/opt/local/bin/python2.7
。For most Python packages, MacPorts has separate ports available for each supported Python version. For example, if you are trying to use PIL (the Python Imaging Library), you need to install the 2.7 version of that port:
That will also install the MacPorts version of Python 2.7, if you don't already have it installed. It is located at
/opt/local/bin/python2.7
.