Home > Backend Development > Python Tutorial > Why Does `pip install psycopg2` Fail on Mavericks with a `-mno-fused-madd` Clang Error?

Why Does `pip install psycopg2` Fail on Mavericks with a `-mno-fused-madd` Clang Error?

Susan Sarandon
Release: 2024-12-03 01:19:11
Original
310 people have browsed it

Why Does `pip install psycopg2` Fail on Mavericks with a `-mno-fused-madd` Clang Error?

clang error: unknown argument: ' -mno-fused-madd' (python package installation failure)

When installing psycopg2 via pip on Mavericks 10.9, an error may arise during compilation:

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

Resolution:

To resolve this issue, set environment variables prior to compilation:

export CFLAGS=-Qunused-arguments
export CPPFLAGS=-Qunused-arguments
Copy after login

If installing as a superuser (e.g., to append to the Apple factory-installed Python distribution), use:

sudo -E pip install psycopg2
Copy after login

Additional Considerations:

  • Apple has fixed this issue with updated system Pythons (2.7, 2.6, and 2.5) in OS X 10.9.3 and later, eliminating the need for the workaround.
  • If using OS X 10.8.x (Mountain Lion) and Xcode 5.1 , the workaround is still required.

The above is the detailed content of Why Does `pip install psycopg2` Fail on Mavericks with a `-mno-fused-madd` Clang Error?. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
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
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template