【问题标题】:How to get python-dev for windows?如何获得适用于 Windows 的 python-dev?
【发布时间】:2013-05-03 03:47:09
【问题描述】:

我们正在尝试安装 PIL 并收到错误

error: command 'gcc' failed with exit status 1

许多类似的问题,包括这个 (installing Reportlab (error: command 'gcc' failed with exit status 1 )),建议安装 python-dev 包。

在哪里可以找到适用于 Windows 7 的资源。pip install python-dev 不起作用。

【问题讨论】:

  • 答案就在PIL网站上,他们有windows的下载

标签: python django


【解决方案1】:

似乎没有适用于 Windows 的 python-dev 包。但是 Windows 的 Python 安装程序通常会在 Python 主目录中安装一个子目录 include

所以使用C:\Python 中的 Python 你会得到:

  • C:\Python
  • C:\Python\DLLs
  • C:\Python\Doc
  • C:\Python\include
  • C:\Python\Lib
  • C:\Python\libs
  • C:\Python\脚本
  • C:\Python\tcl
  • C:\Python\工具

在这个include 目录中,您会找到Python.h,它可以被包含或引用。

【讨论】:

  • 我可以包含 Python.h,但我没有 pyconfig.h。所以我收到Python-2.7.13\Include/Python.h:8:22: fatal error: pyconfig.h: No such file or directory
  • @MeetTaraviya 恐怕你不得不提出一个单独的问题,因为自从回答之后我没有做过太多的 Python 开发......不记得需要pyconfig.h。也许stackoverflow.com/a/28678231/1548776 是个好提示?
  • @MeetTaraviya 也看看svn.python.org/projects/python/trunk/PC/pyconfig.hgithub.com/esa/pagmo/wiki/… 建议 pyconfig.h 包括...
  • @MeetTaraviya 很高兴听到您能够解决它。为了其他有同样问题的人,请您简要解释一下吗?
  • 我在系统上找到了 python-config,运行 python-config --ldflags 并将这些标志添加到链接选项
【解决方案2】:

在 Windows 上获得完整的工作设置(包括 ming 编译器)的最简单方法是安装诸如 pythonxy(我最喜欢的)或 EDP 之类的发行版。

【讨论】:

    【解决方案3】:

    我以前在 Windows 上开发时,这个带有预编译二进制文件的网站非常好用:http://www.lfd.uci.edu/~gohlke/pythonlibs/

    您会在此处找到 PIL 和 ReportLab 的预编译版本。希望对您有所帮助。

    【讨论】:

    • Python 2.7 没有 64 位版本
    • @user1328021 抱歉,请参阅 PIL 网站了解 64 位版本。您在问题中没有提到任何关于 64 位的内容。
    猜你喜欢
    • 2015-03-17
    • 1970-01-01
    • 2011-08-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-09-27
    • 2013-04-10
    • 1970-01-01
    相关资源
    最近更新 更多