Skip to content

Cannot build with python 3.8 on Ubuntu 16

When I try to compile on Ubuntu 16 with Python 3.8.1, I get:

/work/users/jmapel/swigcsm/build/python/csmapi/csmapiPYTHON_wrap.cxx:178:11: fatal error: Python.h: No such file or directory
 # include <Python.h>
           ^~~~~~~~~~
compilation terminated.

It looks like it's looking in the wrong include directory. From cmake:

Executing conda info --root
_r = 0
_o = /usgs/cpkgs/anaconda3_linux
_e = 
Found anaconda root directory /usgs/cpkgs/anaconda3_linux
Executing python --version
_r = 0
_o = Python 3.8.1
_e = Python 3.8.1
Using anaconda /home/jmapel/.conda/envs/swigcsm environment
PYTHON_INCLUDE_DIR = /home/jmapel/.conda/envs/swigcsm/include/python3.8m
PYTHON_LIBRARY = /home/jmapel/.conda/envs/swigcsm/lib/libpython3.8m.so
-- Found CSM Include: /home/jmapel/.conda/envs/swigcsm/include/csm
-- Found CSM Lib: /home/jmapel/.conda/envs/swigcsm/lib/libcsmapi.so