无法安装reportlab mac OS X 10.9.2 + python2.7

时间:2014-04-02 23:02:20

标签: python macos python-2.7 compiler-errors reportlab

我正在努力使用python 2.7在mac OS X 10.9.2上安装reportlab。我设法使用pip3安装它,即使我需要python2.7所以我相信我已经安装了所有必需的软件包。

你能帮帮忙吗?

这是安装日志(如果您需要完整的未提取日志,请询问):

$>pip install reportlab
Downloading/unpacking reportlab
  Downloading reportlab-3.0.tar.gz (1.9MB): 1.9MB downloaded
  Running setup.py egg_info for package reportlab
    ################################################
    #Attempting install of _rl_accel & pyHnj
    #extensions from '/private/tmp/pip_build_root/reportlab/src/rl_addons/rl_accel'
    ################################################
    ################################################
    #Attempting install of _renderPM
    #extensions from '/private/tmp/pip_build_root/reportlab/src/rl_addons/renderPM'
    will use package libart 2.3.12
    # installing with freetype version 21
    ################################################
    Downloading standard T1 font curves
    Finished download of standard T1 font curves

    ()
    ########## SUMMARY INFO #########
    ################################################
    #Attempting install of _rl_accel & pyHnj
    #extensions from '/private/tmp/pip_build_root/reportlab/src/rl_addons/rl_accel'
    ################################################
    ################################################
    #Attempting install of _renderPM
    #extensions from '/private/tmp/pip_build_root/reportlab/src/rl_addons/renderPM'
    will use package libart 2.3.12
    # installing with freetype version 21
    ################################################
    Downloading standard T1 font curves
    Finished download of standard T1 font curves
Installing collected packages: reportlab
  Running setup.py install for reportlab
    ################################################
    #Attempting install of _rl_accel & pyHnj
    #extensions from '/private/tmp/pip_build_root/reportlab/src/rl_addons/rl_accel'
    ################################################
    ################################################
    #Attempting install of _renderPM
    #extensions from '/private/tmp/pip_build_root/reportlab/src/rl_addons/renderPM'
    will use package libart 2.3.12
    # installing with freetype version 21
    ################################################
    Standard T1 font curves already downloaded
    building 'reportlab.lib._rl_accel' extension
    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 -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c /private/tmp/pip_build_root/reportlab/src/rl_addons/rl_accel/_rl_accel.c -o build/temp.macosx-10.9-intel-2.7/private/tmp/pip_build_root/reportlab/src/rl_addons/rl_accel/_rl_accel.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
    Complete output from command /usr/bin/python -c "import setuptools;__file__='/private/tmp/pip_build_root/reportlab/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-xduBeA-record/install-record.txt --single-version-externally-managed:
    ################################################

#Attempting install of _rl_accel & pyHnj

#extensions from '/private/tmp/pip_build_root/reportlab/src/rl_addons/rl_accel'

################################################

################################################

#Attempting install of _renderPM

#extensions from '/private/tmp/pip_build_root/reportlab/src/rl_addons/renderPM'

will use package libart 2.3.12

# installing with freetype version 21

################################################

Standard T1 font curves already downloaded

running install

running build

running build_py

creating build

creating build/lib.macosx-10.9-intel-2.7

creating build/lib.macosx-10.9-intel-2.7/reportlab

copying src/reportlab/__init__.py -> build/lib.macosx-10.9-intel-2.7/reportlab

copying src/reportlab/rl_config.py -> build/lib.macosx-10.9-intel-2.7/reportlab

[...] -> lots of copying/creating lines stripped here for more clarity

running build_ext

creating build/temp.macosx-10.9-intel-2.7/private/tmp/pip_build_root/reportlab/src/rl_addons/rl_accel

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 -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c /private/tmp/pip_build_root/reportlab/src/rl_addons/rl_accel/_rl_accel.c -o build/temp.macosx-10.9-intel-2.7/private/tmp/pip_build_root/reportlab/src/rl_addons/rl_accel/_rl_accel.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

----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools;__file__='/private/tmp/pip_build_root/reportlab/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-Ty1Jj1-record/install-record.txt --single-version-externally-managed failed with error code 1 in /private/tmp/pip_build_root/reportlab
Storing complete log in /Users/hugo/Library/Logs/pip.log

1 个答案:

答案 0 :(得分:3)

刚刚找到解决方案here。 只需在编译之前添加这些env设置,告诉clang忽略错误。

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

希望能有所帮助!