我已经安装了libpng,但在安装autopy时出现错误"'png.h'文件未找到#include <png.h>"

use*_*516 5 python unix opengl macos libpng

我是python的初学者,最近我想在我的Mac上安装autopy(Mavericks,10.9.4).我阅读了很多介绍和其他人的问题.但我仍然无法成功安装autopy.我安装autopy的步骤如下:

  1. 我已经从http://ethan.tira-thompson.com/Mac_OS_X_Ports.html安装了libpng
  2. 我是初学者,我检查/ Library/Frameworks和/ usr/local我觉得我已经正确安装了libpng
  3. [终奌站]git clone git://github.com/msanders/autopy.git
  4. 根据介绍,我写#include <OpenGL/gl.h>在autopy文件的第七行"src/screengrab.c"
  5. [终奌站]cd autopy
  6. [终奌站]python setup.py build

这里有命令窗口

src/png_io.c:3:10: fatal error: 'png.h' file not found
#include <png.h>
          ^
1 error generated.
error: command 'cc' failed with exit status 1
Run Code Online (Sandbox Code Playgroud)

我是否需要在png_io.c中重写"png.h"的文件地址?我该如何在Mac上安装autopy?我有一些重要的遗漏吗?

小智 5

尝试:

sudo apt-get install libpng-dev
Run Code Online (Sandbox Code Playgroud)

我现在正在安装autopy,并坚持同样的步骤.安装libpng-dev后,问题解决了.:)

安装autopy的完整过程如下

  1. sudo apt-get install libx11-dev 解决"#include"找不到错误
  2. sudo apt-get install libxtst-dev 解决"#include"找不到错误
  3. sudo apt-get install libpng-dev 解决"#include"找不到错误
  4. easy_install autopy