在小牛上安装Pillow/PIL

 手机用户2502887185 发布于 2023-01-18 17:08

我尝试使用pip/easy_install安装Pillow时遇到一个奇怪的错误:

cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -DHAVE_LIBJPEG -DHAVE_LIBZ -DHAVE_LIBTIFF -I/System/Library/Frameworks/Tcl.framework/Versions/8.5/Headers -I/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -I/usr/local/Cellar/freetype/2.5.3/include/freetype2 -I/private/var/folders/c_/r7sp373509jdb6_1xmmzvl9c0000gn/T/pip_build_tills13/Pillow/libImaging -I/System/Library/Frameworks/Python.framework/Versions/2.7/include -I/usr/local/include -I/usr/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _imaging.c -o build/temp.macosx-10.9-intel-2.7/_imaging.o

clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future]

clang: note: this will be a hard error (cannot be downgraded to a warning) in the future

error: command 'cc' failed with exit status 1

我已经阅读了所有的符号链接答案,我已经安装了命令行工具,似乎没有任何工作.我总是得到那个错误.

4 个回答
  • 查看brew http://brew.sh

    brew tap Homebrew/python
    brew install pillow
    

    2023-01-18 17:10 回答
  • 我通过以下方式解决了这个问题.可能与今天的Mavericks命令行工具更新有关.尝试在执行pip install之前向终端添加以下内容:

    export CFLAGS=-Qunused-arguments
    export CPPFLAGS=-Qunused-arguments
    

    2023-01-18 17:10 回答
  • 除了@jussi之外,我还要打开终端并执行以下操作:

        sudo bash
        export CFLAGS=-Qunused-arguments
        export CPPFLAGS=-Qunused-arguments
    

    只有这样才能正常运行'pip install pillow'

    如果我没有使用超级用户提示运行它,我会收到以下错误:

        error: could not create '/Library/Python/2.7/site-packages/PIL': Permission denied
    

    我安装了2014年3月的命令行工具,运行OSX 10.9.2.如果有所作为,我也安装了Homebrew.

    2023-01-18 17:10 回答
  • 在终端中运行此命令:

    ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future pip install pillow


    更多信息:

    Xcode 5.1附带的编译器将未知传递的参数视为错误.

    我们告诉它忽略那些"错误"

    来源:http://bruteforce.gr/bypassing-clang-error-unknown-argument.html

    2023-01-18 17:11 回答
撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有