Skip to content

Instantly share code, notes, and snippets.

@goldsmith
Last active January 6, 2024 07:25
Show Gist options
  • Save goldsmith/7262122 to your computer and use it in GitHub Desktop.
Save goldsmith/7262122 to your computer and use it in GitHub Desktop.
How to install Numpy and Scipy on Mac OS X Mavericks (10.9) using Pip.
# set up flags for Numpy C extentions compiling
export CFLAGS="-arch i386 -arch x86_64"
export FFLAGS="-m32 -m64"
export LDFLAGS="-Wall -undefined dynamic_lookup -bundle -arch i386 -arch x86_64"
export CC=gcc-4.2
export CXX="g++ -arch i386 -arch x86_64"
pip install numpy
# success!
# now for scipy
easy_install cython
# make sure you have Homebrew
brew install gfortran
# if this is too slow or has an error
# install gfotran from the Mac OS X Lion installer for Intel 64-bit processors
# http://gcc.gnu.org/wiki/GFortranBinaries#MacOS
# finally
pip install -e git+https://github.com/scipy/scipy#egg=scipy-dev
# Let me know if this works for you! [email protected]
@scw
Copy link

scw commented Apr 3, 2014

I've been having this same problem, for pretty much any packages which build C/C++ code. I made a small wrapper around this process so that pip gets the right environment directly. It seems to work OK for me, and makes it less annoying to manage the shell variables on a per-session basis.

@llvll0hsen
Copy link

I have some problem with Cpython . any got any solution:
Searching for cython
Reading http://pypi.python.org/simple/cython/
Best match: Cython 0.20.1
Downloading https://pypi.python.org/packages/source/C/Cython/Cython-0.20.1.tar.gz#md5=52431696c64e618036537c4d9aa79d99
Processing Cython-0.20.1.tar.gz
Running Cython-0.20.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-P4GGuh/Cython-0.20.1/egg-dist-tmp-SNjzLk
warning: no files found matching '.pyx' under directory 'Cython/Debugger/Tests'
warning: no files found matching '
.pxd' under directory 'Cython/Debugger/Tests'
warning: no files found matching '.h' under directory 'Cython/Debugger/Tests'
warning: no files found matching '
.pxd' under directory 'Cython/Utility'
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: Setup script exited with error: command 'cc' failed with exit status 1

@goldsmith
Copy link
Author

try this?

export CFLAGS="-arch i386 -arch x86_64 -Qunused-arguments"
export CPPFLAGS="-Qunused-arguments"

@entryword
Copy link

Thanks a lot!
and thank you @fogathmann it works for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment