Home  >  Article  >  Backend Development  >  Why Does `pip install psycopg2` Fail with \'unknown argument: \'-mno-fused-madd\'\' on OS X?

Why Does `pip install psycopg2` Fail with \'unknown argument: \'-mno-fused-madd\'\' on OS X?

DDD
DDDOriginal
2024-11-25 10:53:11228browse

Why Does `pip install psycopg2` Fail with

clang error: unknown argument: '-mno-fused-madd' while installing psycopg2

This error occurs when attempting to install psycopg2 via pip on Mavericks 10.9. It results from an unknown argument, '-mno-fused-madd', passed to the clang compiler.

Resolution:

To resolve this issue, modify the environment variables before compilation by setting the following:

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

Additional Considerations for Superuser Installation:

If the installation is performed as a superuser, add the following prefix to the pip command:

sudo -E pip install psycopg2

OSX Updates and Workaround Validity:

This workaround was necessary for OS X 10.8.x and Xcode 5.1 . However, as of OS X 10.9.3, Apple has fixed this issue for system Pythons (2.7, 2.6, and 2.5). Therefore, the workaround is no longer required for the latest Mavericks and Xcode 5.1 versions.

The above is the detailed content of Why Does `pip install psycopg2` Fail with \'unknown argument: \'-mno-fused-madd\'\' on OS X?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn