I’m running Windows Subsystem Linux (WSL) to run GridDB. I’m trying to install the Python client, version 0.8.5, available at https://github.com/griddb/python_client/archive/0.8.5.tar.gz, following the instructions from GridDB Docs, available at https://docs.griddb.net/latest/gettingstarted/python/#using-python.
However, when I run the make command I get the following error:
$ cd python_client-0.8.5
$ make
g++ -fPIC -std=c++0x -g -O2 -c -o src/TimeSeriesProperties.o -Iinclude -Isrc src/TimeSeriesProperties.cpp
g++ -fPIC -std=c++0x -g -O2 -c -o src/ContainerInfo.o -Iinclude -Isrc src/ContainerInfo.cpp
g++ -fPIC -std=c++0x -g -O2 -c -o src/AggregationResult.o -Iinclude -Isrc src/AggregationResult.cpp
g++ -fPIC -std=c++0x -g -O2 -c -o src/Container.o -Iinclude -Isrc src/Container.cpp
g++ -fPIC -std=c++0x -g -O2 -c -o src/Store.o -Iinclude -Isrc src/Store.cpp
g++ -fPIC -std=c++0x -g -O2 -c -o src/StoreFactory.o -Iinclude -Isrc src/StoreFactory.cpp
g++ -fPIC -std=c++0x -g -O2 -c -o src/PartitionController.o -Iinclude -Isrc src/PartitionController.cpp
g++ -fPIC -std=c++0x -g -O2 -c -o src/Query.o -Iinclude -Isrc src/Query.cpp
g++ -fPIC -std=c++0x -g -O2 -c -o src/QueryAnalysisEntry.o -Iinclude -Isrc src/QueryAnalysisEntry.cpp
g++ -fPIC -std=c++0x -g -O2 -c -o src/RowKeyPredicate.o -Iinclude -Isrc src/RowKeyPredicate.cpp
g++ -fPIC -std=c++0x -g -O2 -c -o src/RowList.o -Iinclude -Isrc src/RowList.cpp
g++ -fPIC -std=c++0x -g -O2 -c -o src/RowSet.o -Iinclude -Isrc src/RowSet.cpp
g++ -fPIC -std=c++0x -g -O2 -c -o src/TimestampUtils.o -Iinclude -Isrc src/TimestampUtils.cpp
g++ -fPIC -std=c++0x -g -O2 -c -o src/Field.o -Iinclude -Isrc src/Field.cpp
g++ -fPIC -std=c++0x -g -O2 -c -o src/Util.o -Iinclude -Isrc src/Util.cpp
swig -DSWIGWORDSIZE64 -outdir . -o src/griddb_python.cxx -c++ -python src/griddb.i
g++ -fPIC -std=c++0x -g -O2 -c -o src/griddb_python.o -Iinclude -Isrc -I/usr/include/python3.12 -I/usr/include/python3.12 -I/usr/local/lib/python3.12/dist-packages/numpy/core/include src/griddb_python.cxx
src/griddb_python.cxx:3185:10: fatal error: numpy/arrayobject.h: No such file or directory
3185 | #include <numpy/arrayobject.h>
| ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:58: src/griddb_python.o] Error 1
Any Ideas?
I’ve tried to install numpy and pandas, via apt, but still get the same error.
$ sudo apt install python3-numpy
$ sudo apt install python3-pandas
Danilo Silva is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
After verifying the Makefile, I was able to pinpoint the issue. Line 17, shown below, retrieves a list of site packages and picks the first one.
NUMPY_FLAGS := $(shell python3 -c “import site; print(site.getsitepackages()[0])”)
Running the command python3 -c “import site; print(site.getsitepackages()[0])” returns the following:
[‘/usr/local/lib/python3.12/dist-packages’, ‘/usr/lib/python3/dist-packages’, ‘/usr/lib/python3.12/dist-packages’]
However, in my WSL Ubuntu installation, there is no directory “dist-packages” under python3.12. That directory is under python3 and that’s what causes the error, as it tries to include “-I/usr/local/lib/python3.12/dist-packages/numpy/core/include”.
The solution was to edit the Makefile and change line 17 to NUMPY_FLAGS := $(shell python3 -c “import site; print(site.getsitepackages()[1])”) so it would pick the second item on the list, ‘/usr/lib/python3/dist-packages’, thus preventing the error from happening.
Danilo Silva is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.