【问题标题】:Psycopg2 Error: clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future]Psycopg2 错误:clang:错误:未知参数:'-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future]
【发布时间】:2014-11-24 12:28:04
【问题描述】:

一直在尝试以多种方式安装 psycopg2,但我不断收到与此类似的错误:

$ pip install psycopg2
    Downloading/unpacking psycopg2
      Downloading psycopg2-2.5.4.tar.gz (682kB): 682kB downloaded
      Running setup.py (path:/private/var/folders/6p/0z5pjhdn47b7r2x0c4fjy3tw0000gp/T/pip_build_nir/psycopg2/setup.py) egg_info for package psycopg2

    Installing collected packages: psycopg2
      Running setup.py install for psycopg2
        building 'psycopg2._psycopg' 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 -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.5.4 (dt dec pq3 ext)" -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -DPG_VERSION_HEX=0x090304 -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I. -I/usr/local/Cellar/postgresql/9.3.4/include -I/usr/local/Cellar/postgresql/9.3.4/include/server -c psycopg/psycopgmodule.c -o build/temp.macosx-10.9-intel-2.7/psycopg/psycopgmodule.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, tokenize;__file__='/private/var/folders/6p/0z5pjhdn47b7r2x0c4fjy3tw0000gp/T/pip_build_nir/psycopg2/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/6p/0z5pjhdn47b7r2x0c4fjy3tw0000gp/T/pip-igitig-record/install-record.txt --single-version-externally-managed --compile:
        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/psycopg2

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

    copying lib/_json.py -> build/lib.macosx-10.9-intel-2.7/psycopg2

    copying lib/_range.py -> build/lib.macosx-10.9-intel-2.7/psycopg2

    copying lib/errorcodes.py -> build/lib.macosx-10.9-intel-2.7/psycopg2

    copying lib/extensions.py -> build/lib.macosx-10.9-intel-2.7/psycopg2

    copying lib/extras.py -> build/lib.macosx-10.9-intel-2.7/psycopg2

    copying lib/pool.py -> build/lib.macosx-10.9-intel-2.7/psycopg2

    copying lib/psycopg1.py -> build/lib.macosx-10.9-intel-2.7/psycopg2

    copying lib/tz.py -> build/lib.macosx-10.9-intel-2.7/psycopg2

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

    copying tests/__init__.py -> build/lib.macosx-10.9-intel-2.7/psycopg2/tests

    copying tests/dbapi20.py -> build/lib.macosx-10.9-intel-2.7/psycopg2/tests

    copying tests/dbapi20_tpc.py -> build/lib.macosx-10.9-intel-2.7/psycopg2/tests

    copying tests/test_async.py -> build/lib.macosx-10.9-intel-2.7/psycopg2/tests

    copying tests/test_bug_gc.py -> build/lib.macosx-10.9-intel-2.7/psycopg2/tests

    copying tests/test_bugX000.py -> build/lib.macosx-10.9-intel-2.7/psycopg2/tests

    copying tests/test_cancel.py -> build/lib.macosx-10.9-intel-2.7/psycopg2/tests

    copying tests/test_connection.py -> build/lib.macosx-10.9-intel-2.7/psycopg2/tests

    copying tests/test_copy.py -> build/lib.macosx-10.9-intel-2.7/psycopg2/tests

    copying tests/test_cursor.py -> build/lib.macosx-10.9-intel-2.7/psycopg2/tests

    copying tests/test_dates.py -> build/lib.macosx-10.9-intel-2.7/psycopg2/tests

    copying tests/test_extras_dictcursor.py -> build/lib.macosx-10.9-intel-2.7/psycopg2/tests

    copying tests/test_green.py -> build/lib.macosx-10.9-intel-2.7/psycopg2/tests

    copying tests/test_lobject.py -> build/lib.macosx-10.9-intel-2.7/psycopg2/tests

    copying tests/test_module.py -> build/lib.macosx-10.9-intel-2.7/psycopg2/tests

    copying tests/test_notify.py -> build/lib.macosx-10.9-intel-2.7/psycopg2/tests

    copying tests/test_psycopg2_dbapi20.py -> build/lib.macosx-10.9-intel-2.7/psycopg2/tests

    copying tests/test_quote.py -> build/lib.macosx-10.9-intel-2.7/psycopg2/tests

    copying tests/test_transaction.py -> build/lib.macosx-10.9-intel-2.7/psycopg2/tests

    copying tests/test_types_basic.py -> build/lib.macosx-10.9-intel-2.7/psycopg2/tests

    copying tests/test_types_extras.py -> build/lib.macosx-10.9-intel-2.7/psycopg2/tests

    copying tests/test_with.py -> build/lib.macosx-10.9-intel-2.7/psycopg2/tests

    copying tests/testconfig.py -> build/lib.macosx-10.9-intel-2.7/psycopg2/tests

    copying tests/testutils.py -> build/lib.macosx-10.9-intel-2.7/psycopg2/tests

    running build_ext

    building 'psycopg2._psycopg' extension

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

    creating build/temp.macosx-10.9-intel-2.7/psycopg

    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 -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.5.4 (dt dec pq3 ext)" -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -DPG_VERSION_HEX=0x090304 -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I. -I/usr/local/Cellar/postgresql/9.3.4/include -I/usr/local/Cellar/postgresql/9.3.4/include/server -c psycopg/psycopgmodule.c -o build/temp.macosx-10.9-intel-2.7/psycopg/psycopgmodule.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, tokenize;__file__='/private/var/folders/6p/0z5pjhdn47b7r2x0c4fjy3tw0000gp/T/pip_build_nir/psycopg2/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/6p/0z5pjhdn47b7r2x0c4fjy3tw0000gp/T/pip-igitig-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /private/var/folders/6p/0z5pjhdn47b7r2x0c4fjy3tw0000gp/T/pip_build_nir/psycopg2
    Storing debug log for failure in /Users/nir/Library/Logs/pip.log

我尝试了很多命令,包括重新安装 postgresql 和 django-toolbelt。似乎没有什么不同,会发生相同的“类型”错误。我还将 postgresql 包含到我的 $PATH 中:export PYTHONPATH=$PYTHONPATH:/Library/PostgreSQL/9.3/bin/pg_config

我在 OSX Maverick 上。我正在运行 python 2.7 和 django 1.6。

有什么想法吗?

【问题讨论】:

    标签: python django postgresql psycopg2


    【解决方案1】:

    我实际上并不知道答案,但是,我搜索了一下,因为我使用了您遇到问题的所有组件。我遇到了这个:

    http://kaspermunck.github.io/2014/03/fixing-clang-error/
    

    所以,你可以试试这样的:

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

    问题似乎在于 cc 命令行包含对 cc 没有意义的参数,并且它曾经是一个软错误,但现在它是一个致命错误。祝你好运!

    -g

    【讨论】:

    • 朋友,你是英雄。非常感谢!
    猜你喜欢
    • 2014-05-07
    • 2014-05-26
    • 2014-10-24
    • 1970-01-01
    • 2014-06-02
    • 2014-04-18
    • 1970-01-01
    • 1970-01-01
    • 2014-04-14
    相关资源
    最近更新 更多