GUDHI / gudhi-devel

The GUDHI library is a generic open source C++ library, with a Python interface, for Topological Data Analysis (TDA) and Higher Dimensional Geometry Understanding.
https://gudhi.inria.fr/
MIT License
259 stars 66 forks source link

`make sphinx` uses the system version of gudhi if present #129

Open mglisse opened 5 years ago

mglisse commented 5 years ago

While working on some branch, make sphinx gave me the error:

WARNING: autodoc: failed to import function 'wasserstein.wasserstein_distance' from module 'gudhi'; the following exception was raised: No module named 'gudhi.wasserstein'

Using strace, I noticed that it was using the system version of gudhi instead of the one I had just built. I then removed the system version, and rerunning make sphinx worked. I reinstalled it and re-ran make sphinx, which now uses the system version of gudhi for cython plugins and the local version for persistence_graphical_tools and wasserstein. I don't know how the paths are handled, but that seems messy...

VincentRouvreau commented 5 years ago

If you set environment variable PYTHONPATH with your local build (as explained in the documentation here ), it shall do the work. The order of search path for module import is explained here: https://docs.python.org/3/tutorial/modules.html#the-module-search-path

mglisse commented 5 years ago

cmake already sets PYTHONPATH, and it is still failing. Setting it manually doesn't help.

VincentRouvreau commented 5 years ago

And what is the result of the following command:

python -c "import sys;print(sys.path)"
mglisse commented 5 years ago
['', '/usr/lib/python37.zip', '/usr/lib/python3.7', '/usr/lib/python3.7/lib-dynload', '/home/glisse/.local/lib/python3.7/site-packages', '/usr/local/lib/python3.7/dist-packages', '/usr/lib/python3/dist-packages', '/usr/lib/python3.7/dist-packages']
without PYTHONPATH,
['', '/home/glisse/repos/gudhi-master/build/2019-11-07-10-44-04_GUDHI_3.0.0.rc1/build/python', '/usr/lib/python37.zip', '/usr/lib/python3.7', '/usr/lib/python3.7/lib-dynload', '/home/glisse/.local/lib/python3.7/site-packages', '/usr/local/lib/python3.7/dist-packages', '/usr/lib/python3/dist-packages', '/usr/lib/python3.7/dist-packages']
with it.