Skip to content

Instantly share code, notes, and snippets.

@necrolyte2
Last active November 15, 2017 15:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save necrolyte2/530e9b39dcb0259b69d4 to your computer and use it in GitHub Desktop.
Save necrolyte2/530e9b39dcb0259b69d4 to your computer and use it in GitHub Desktop.
numpy_issue_2434
# Install our own python
prefix=$(mktemp -d)
cd $prefix
version=2.7.8
wget --no-check-certificate https://www.python.org/ftp/python/${version}/Python-${version}.tgz -O- | tar xzf -
cd Python-${version}
./configure --prefix $prefix
make
make install
cd ..
# Install/Setup virtualenv
wget --no-check-certificate https://pypi.python.org/packages/source/v/virtualenv/virtualenv-1.11.6.tar.gz#md5=f61cdd983d2c4e6aeabb70b1060d6f49 -O- | tar xzf -
${prefix}/bin/python virtualenv-1.11.6/virtualenv.py env
. env/bin/activate
# Install setuptools
wget "https://bootstrap.pypa.io/ez_setup.py" -O- | ${prefix}/bin/python
# Create setup.py that has numpy as dependency
cat <<EOF > setup.py
# Use setuptools
from setuptools import setup, find_packages
setup(
name = "numpyfail",
version = '0.0.1',
packages = find_packages(),
install_requires = [
'numpy',
],
setup_requires = [
],
tests_require = [
],
author = 'Tyghe Vallard',
author_email = 'vallardt@gmail.com',
)
EOF
# If you do not put the C_INCLUDE_PATH you will get the error that Python.h cannot be found
# Python.h: No such file or directory
# export C_INCLUDE_PATH=${prefix}/Python-2.7.8:${prefix}/Python-2.7.8/Include
#
# Still gets you this error
# error: Setup script exited with error: Command "gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Inumpy/core/include -Ibuild/src.linux-x86_64-2.7/numpy/core/include/numpy -Ibuild/src.linux-x86_64-2.7/numpy/core/src/private -Ibuild/src.linux-x86_64-2.7/numpy/core/src/private -Ibuild/src.linux-x86_64-2.7/numpy/core/src/private -Ibuild/src.linux-x86_64-2.7/numpy/core/src/private -c build/src.linux-x86_64-2.7/numpy/core/src/npymath/ieee754.c -o build/temp.linux-x86_64-2.7/build/src.linux-x86_64-2.7/numpy/core/src/npymath/ieee754.o" failed with exit status 1
#
# Above that error are some errors about not being able to find some of numpy's math headers
# numpy/core/src/npymath/ieee754.c.src:7:29: error: npy_math_common.h: No such file or directory
# numpy/core/src/npymath/ieee754.c.src:8:30: error: npy_math_private.h: No such file or directory
python setup.py develop
@szechyjs
Copy link

szechyjs commented Jan 7, 2016

you ever figure out a fix for this?

@Rafff
Copy link

Rafff commented Nov 29, 2016

Did you ?

@nicbou
Copy link

nicbou commented Nov 15, 2017

I found one possible answer that solved it for me: https://abriefsummaryofeverything.blogspot.de/2016/08/ieee754csrc729-fatal-error.html

sudo apt-get remove python-virtualenv
sudo pip install virtualenv

virtualenv from apt-get doesn't come with setuptools.

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