GVKun编程网logo

clang 错误:未知参数:'-mno-fused-madd'(python 包安装失败)(未知错误code=0)

12

如果您对clang错误:未知参数:'-mno-fused-madd'感兴趣,那么本文将是一篇不错的选择,我们将为您详在本文中,您将会了解到关于clang错误:未知参数:'-mno-fused-madd

如果您对clang 错误:未知参数:'-mno-fused-madd'感兴趣,那么本文将是一篇不错的选择,我们将为您详在本文中,您将会了解到关于clang 错误:未知参数:'-mno-fused-madd'的详细内容,我们还将为您解答python 包安装失败的相关问题,并且为您提供关于Anaconda运行时错误:未将Python安装为框架吗?、c – 错误Xcode 5.1:未知参数:’ – cclib'[-Wunused-command-line-argument-hard-error-in-future]、CMake 错误:未知参数 --clean-first、command not found: django-admin.py 的解决办法(python2.7)的有价值信息。

本文目录一览:

clang 错误:未知参数:'-mno-fused-madd'(python 包安装失败)(未知错误code=0)

clang 错误:未知参数:'-mno-fused-madd'(python 包安装失败)(未知错误code=0)

如何解决clang 错误:未知参数:''-mno-fused-madd''(python 包安装失败)?

您可以通过在编译之前设置以下环境变量来告诉 clang 不要将此作为错误提出:

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

然后pip install psycopg2应该工作。

尝试时我也有同样的情况pip install lxml

编辑:如果您以超级用户身份安装(如果您尝试附加到/Library/Python/2.7/site-packagesOS X 附带的原生 Apple 工厂安装的 Python 发行版,而不是您随后自己安装的其他 Python 发行版,则可能会出现这种情况),那么您将需要按照@Thijs Kuipers 在以下评论中的描述进行操作:

sudo -E pip install psycopg2

或等效的,对于您可能替换的任何其他包名称psycopg2.

更新 [2014-05-16]:Apple 已通过更新的系统 Python(2.7、2.6 和 2.5)修复了此问题,OS X 10.9.3因此在使用最新的 Mavericks 和Xcode 5.1+. OS X 10.8.x但是,到目前为止,如果您在那里使用(Mountain Lion,目前为 10.8.5),仍然需要解决方法Xcode 5.1+

解决方法

尝试psycopg2在 Mavericks 10.9 上通过 pip 安装时出现以下错误:

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

不知道如何继续,并已在此处和其他地方搜索此特定错误。任何帮助深表感谢!

这是 pip 的完整输出:

$ pip install psycopg2
Downloading/unpacking psycopg2
  Downloading psycopg2-2.5.2.tar.gz (685kB): 685kB downloaded
  Running setup.py (path:/private/var/folders/0z/ljjwsjmn4v9_zwm81vhxj69m0000gn/T/pip_build_tino/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.2 (dt dec pq3 ext)" -DPG_VERSION_HEX=0x090303 -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.3/include -I/usr/local/Cellar/postgresql/9.3.3/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/0z/ljjwsjmn4v9_zwm81vhxj69m0000gn/T/pip_build_tino/psycopg2/setup.py'';exec(compile(getattr(tokenize,''open'',open)(__file__).read().replace(''\r\n'',''\n''),__file__,''exec''))" install --record /var/folders/0z/ljjwsjmn4v9_zwm81vhxj69m0000gn/T/pip-bnWiwB-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.2 (dt dec pq3 ext)" -DPG_VERSION_HEX=0x090303 -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.3/include -I/usr/local/Cellar/postgresql/9.3.3/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,''exec''))" install --record /var/folders/0z/ljjwsjmn4v9_zwm81vhxj69m0000gn/T/pip-bnWiwB-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /private/var/folders/0z/ljjwsjmn4v9_zwm81vhxj69m0000gn/T/pip_build_tino/psycopg2

Anaconda运行时错误:未将Python安装为框架吗?

Anaconda运行时错误:未将Python安装为框架吗?

我已经使用pkg安装程序安装了Anaconda:

Python 2.7.10 |Continuum Analytics,Inc.| (default,May 28 2015,17:04:42) 
[GCC 4.2.1 (Apple Inc. build 5577)] on darwin
Type "help","copyright","credits" or "license" for more information.
Anaconda is brought to you by Continuum Analytics.
Please check out: http://continuum.io/thanks and https://binstar.org

但是当我尝试使用matplotlib中的任何东西时,即:

 from matplotlib import pyplot as plt

我懂了

RuntimeError: Python is not installed as a framework.
The Mac OS X backend will not be able to function correctly if Python is not installed 
as a framework. See the Python documentation for more information on installing Python 
as a framework on Mac OS X. Please either reinstall Python as a framework,or try one of the other backends.

我真的不确定这意味着什么,或者如何解决它。

c – 错误Xcode 5.1:未知参数:’ – cclib'[-Wunused-command-line-argument-hard-error-in-future]

c – 错误Xcode 5.1:未知参数:’ – cclib'[-Wunused-command-line-argument-hard-error-in-future]

今天,Apple发布了iOS 7.1.因此,我必须下载 Xcode 5.1以在iOS 7.1上构建.在我的代码中有C语言.但是当我构建时,我有一个错误:

unkNown argument: ''-cclib'' [-Wunused-command-line-argument-hard-error-in-future]

有人告诉:这是一个严重的问题,因为clang不支持几个常见的gcc标志(最明显的是-mno-fused-madd)

那么,我该如何解决这个问题,或者我必须等待Apple的修复版本?

解决方法

OP的答案:

解决:

我找到了这个问题的答案.我在Build Setting / Other Linker Flag中删除了-cclib标志.并且没有错误发生.我认为clang编译器不需要-cclib.

我看到有人也有同样的问题:未知参数:-fno-obj-arc''[-Wunused-command-line-argument-hard-error-in-future].请用-fno-objc-arc替换-fno-obj-arc

CMake 错误:未知参数 --clean-first

CMake 错误:未知参数 --clean-first

如何解决CMake 错误:未知参数 --clean-first?

运行以下 CMake 命令时,我收到错误消息。我正在使用 CMake 版本 3.20.5。

cmake --clean-first ./src/basis_universal/CMakeLists.txt

CMake Error: UnkNown argument --clean-first

然而,--clean-first appears to be supported。

解决方法

只是为了让您清楚地了解...通常在任何 cmake 项目中都需要执行 2 个步骤...配置和构建。

在配置步骤中,CMake 会在您的系统、编译器等中查找文件,并为构建做好一切准备。

将代码实际转换为可执行文件的构建步骤是第二个单独的步骤。

跑步时

cmake --clean-first ./src/basis_universal/CMakeLists.txt

您只是在配置您的项目。 --clean-first 命令在配置期间不可用。

配置完成后,您需要构建您的项目。在该步骤中,您可以使用 --clean-first 选项。

command not found: django-admin.py 的解决办法(python2.7)

command not found: django-admin.py 的解决办法(python2.7)

天升级了 linux 下的 python,又安装了 Django,按照网上的思路

在 linux 命令行下

1
2
3
python   
#在进入python命令行之后再导入django
improt django

再执行

1
django-admin.py startproject mysite

提示 command not found: django-admin.py 问题应该就就是没有把 django-admin.py 的路径加入环境变量

只需要找到 django-admin.py 的路径就行。我参考了官方文档:

https://code.djangoproject.com/wiki/InstallationPitfalls

但是那个文档是 2 年前的东西,只有 2.4 和 2.6 的,而我的 python 是 2.7 版本的。我试了下,完全不对。

不过思路是清晰了,就是加软链接的操作

linux 命令也忘记的差不多了。用 find /-name django-admin.py 找不到,不知道是不是命令有误。。。

最后打开文件夹找,在 python27/bin/ 里面看到了 django-admin.py。

那就行了!如下图!

QQ拼音截图未命名.jpg

QQ拼音截图未命名2.jpg


我们今天的关于clang 错误:未知参数:'-mno-fused-madd'python 包安装失败的分享就到这里,谢谢您的阅读,如果想了解更多关于Anaconda运行时错误:未将Python安装为框架吗?、c – 错误Xcode 5.1:未知参数:’ – cclib'[-Wunused-command-line-argument-hard-error-in-future]、CMake 错误:未知参数 --clean-first、command not found: django-admin.py 的解决办法(python2.7)的相关信息,可以在本站进行搜索。

本文标签: