Cannot install scipy

For Ubuntu, the system build dependencies to install are listed in the documentation. That, optionally substituting python3-dev for python-dev should be all you need.

So if you do choose to build from source because you need a new version, these two should be the only two commands necessary:

sudo apt-get install gcc gfortran python-dev python3-dev libopenblas-dev liblapack-dev cython cython3
pip3 (or pip for python 2) install --upgrade scipy

–upgrade since I already have a scipy installed in /usr/lib/…

Some of the apt dependencies listed above are duplicates that can be removed if you care about size, like if you’re making a Docker image. You could also do the pip install in virtual env if you wanted.

I am starting that now with the default pip on my Xavier (which has the same rootfs). I will update if it builds or fails.

Edit: it failed with both the default pip and an upgraded one.

error: Command "aarch64-linux-gnu-g++ -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPOCKETFFT_PTHREADS -I/home/user/.local/include/python3.6m -I/usr/local/include/python3.6 -I/home/user/.local/lib/python3.6/site-packages/numpy/core/include -I/usr/include/python3.6m -c scipy/fft/_pocketfft/pypocketfft.cxx -o build/temp.linux-aarch64-3.6/scipy/fft/_pocketfft/pypocketfft.o -MMD -MF build/temp.linux-aarch64-3.6/scipy/fft/_pocketfft/pypocketfft.o.d -std=c++14 -fvisibility=hidden" failed with exit status 1

I am going to try a “pip3 install pybind11” and update as suggested by S4WRXTTCS. It seems to already be installed. If it suceeds, the setup.py for scipy should probably be updated.

Edit, it works:

$ pip3 install pybind11
Collecting pybind11
  Using cached https://files.pythonhosted.org/packages/4b/4d/ae1c4d8e8b139afa9682054dd42df3b0e3b5c1731287933021b9fd7e9cc4/pybind11-2.4.3-py2.py3-none-any.whl
Installing collected packages: pybind11
Successfully installed pybind11-2.4.3
 $ pip3 install --no-cache --upgrade scipy
Collecting scipy
  Downloading https://files.pythonhosted.org/packages/04/ab/e2eb3e3f90b9363040a3d885ccc5c79fe20c5b8a3caa8fe3bf47ff653260/scipy-1.4.1.tar.gz (24.6MB)
    100% |████████████████████████████████| 24.6MB 49.8MB/s 
Installing collected packages: scipy
  Running setup.py install for scipy ... done
Successfully installed scipy-1.4.1