An error occurred while trying to install pyamg: clang: error: there is no such file or directory: '"-I /.../ boost_1_59_0"'

I am trying to install pyamg in my virtual environment. However, I get the following error. I am using Mac OS.

c++: pyamg/amg_core/amg_core_wrap.cxx clang: error: no such file or directory: '"-I/Users/mas/PycharmProjects/kaggle-ndsb/boost_1_59_0"' clang: error: no such file or directory: '"-I/Users/mas/PycharmProjects/kaggle-ndsb/boost_1_59_0"' error: Command "c++ -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE "-I/Users/mas/PycharmProjects/kaggle-ndsb/boost_1_59_0" -arch x86_64 -arch i386 -pipe -D__STDC_FORMAT_MACROS=1 -I/Users/mas/PycharmProjects/Whale/Zahraa5/lib/python2.7/site-packages/numpy/core/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c pyamg/amg_core/amg_core_wrap.cxx -o build/temp.macosx-10.10-intel-2.7/pyamg/amg_core/amg_core_wrap.o" failed with exit status 1 
+8
python compiler-errors pyamg
source share
3 answers

In fact, I think @oarfish correctly named it in the comments. The problem is the ridiculous " and " characters in these paths, which are different from the usual double quote character " .

The following error is reproduced for me:

 ~$ CPPFLAGS="-I/Users/mas/PycharmProjects/kaggle-ndsb/boost_1_59_0" \ LIBS="-L/Users/mas/PycharmProjects/kaggle-ndsb/boost_1_59_0/stage/lib" \ pip install pyamg Collecting pyamg Downloading pyamg-3.0.1.tar.gz (759kB) 100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 761kB 33.2MB/s Installing collected packages: pyamg Running setup.py install for pyamg ... creating build/temp.linux-x86_64-2.7 creating build/temp.linux-x86_64-2.7/pyamg creating build/temp.linux-x86_64-2.7/pyamg/amg_core compile options: '-D__STDC_FORMAT_MACROS=1 -I/home/alistair/.venvs/pyamg/local/lib/python2.7/site-packages/numpy/core/include -I/usr/include/python2.7 -c' c++: pyamg/amg_core/amg_core_wrap.cxx g++: error: "-I/Users/mas/PycharmProjects/kaggle-ndsb/boost_1_59_0": No such file or directory g++: error: "-I/Users/mas/PycharmProjects/kaggle-ndsb/boost_1_59_0": No such file or directory error: Command "c++ -pthread -DNDEBUG -g -fwrapv -O2 -Wall -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security "-I/Users/mas/PycharmProjects/kaggle-ndsb/boost_1_59_0" -fPIC -D__STDC_FO RMAT_MACROS=1 -I/home/alistair/.venvs/pyamg/local/lib/python2.7/site-packages/numpy/core/include -I/usr/include/python2.7 -c pyamg/amg_core/amg_core_wrap.cxx -o build/temp.linux-x86_64-2.7/pyamg/amg_core/amg_core_wrap.o" failed with exit status 1 ---------------------------------------- Command "/home/alistair/.venvs/pyamg/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-Cl5_2g/pyamg/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" insta ll --record /tmp/pip-kkjcoa-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/alistair/.venvs/pyamg/include/site/python2.7/pyamg" failed with error code 1 in /tmp/pip-build-Cl5_2g/pyamg 

While with the characters " installation is completed successfully:

 ~$ CPPFLAGS="-I/Users/mas/PycharmProjects/kaggle-ndsb/boost_1_59_0" \ LIBS="-L/Users/mas/PycharmProjects/kaggle-ndsb/boost_1_59_0/stage/lib" \ pip install pyamg Collecting pyamg Using cached pyamg-3.0.1.tar.gz Installing collected packages: pyamg Running setup.py install for pyamg Successfully installed pyamg-3.0.1 

The paths themselves do not matter - compilation succeeds despite the fact that these directories do not actually exist on my machine.

+1
source share

Use Anaconda or Miniconda

 conda install pyamg 

It only takes a few seconds.

You can create an environment using

 conda create --name my_env python=2.7 

Change to it:

 source activate my_env 

and install pyamg :

 conda install pyamg 

You can still use pip to install conda packages conda cannot find.

Life is too short to waste time compiling problems.;)

+4
source share

I am pretty sure that -I at the beginning of the path is something that twists everything. I bet if you tried to add these export instructions back to .bashrc, but pulled out the -I and -L prefixes, then your original command will start working.

Perhaps you had these reasons for some reason, I have never seen this, but removing these prefixes will probably work.

+2
source share

All Articles