Search code examples
pythoncompiler-errorsquotation-markspyamg

Error when trying to install pyamg: clang: error: no such file or directory: '“-I/.../boost_1_59_0”'


I am trying to install pyamg in my virtual environment. However, I am getting 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

Solution

  • Actually, I think @oarfish called it correctly in the comments. The problem seems to be the funny and characters in those paths, which are distinct from the usual " double quote symbol.

    The following reproduces the error 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
    

    Whereas with " symbols the installation succeeds:

    ~$ 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 are irrelevant - the compilation succeeds in spite of the fact that those directories don't actually exist on my machine.