A cloudy day, but this book still sparkles! Looking forward to some mathematical morning inspiration from Talithia Williams.
Month: July 2018
Installing Dionysus for Python
Today I finally managed to install Dionysus 2, a library for computing persistent homology. I easily set up Kepler-mapper a long time ago, and had given up on Dionysus previously. Dionysus 2 is a re-write that streamlines many things and promises to make installation easier and implement more plotting. Again, I had trouble installing the package, but this time I didn’t give up and eventually met with success.
First, I’ll say that I’m using the Anaconda distribution for Python etc. I have Python 2.7 as the base installation but have almost entirely switched over to Python 3 for my other work. I was merrily going on my way trying to install Dionysus 2 in my Anaconda Python 3.4 environment for a while. First I tried pip, following the commands under the “Get, Build, Install” section link. I ran into some permission problems, some problems with Boost. Given that, I tried cloning the git repository. Still problems with Boost, though I had a fresh install of that as well. After the cmake .. command, I got problems like this:
— Could NOT find Boost
— pybind11 v2.2.0
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
Boost_INCLUDE_DIR (ADVANCED)
and then a string of things. I modified my CMakeCache.txt file; modified the CMakeLists.txt file; tried all sorts of things. Failures. Ok, incremental progress — I think I got it finding the Boost libraries and managed to get my error messages to
— The C compiler identification is Clang 7.3.0
— The CXX compiler identification is Clang 7.3.0
— Check for working C compiler: /usr/bin/cc
— Check for working C compiler: /usr/bin/cc — works
— Detecting C compiler ABI info
— Detecting C compiler ABI info – done
— Check for working CXX compiler: /usr/bin/c++
— Check for working CXX compiler: /usr/bin/c++ — works
— Detecting CXX compiler ABI info
— Detecting CXX compiler ABI info – done
— Could NOT find Boost
— Found PythonInterp: /Users/kaisa/anaconda/envs/py34/bin/python (found version “3.4.5”)
— Found PythonLibs: /Users/kaisa/anaconda/envs/py34/lib/libpython3.4m.dylib
— Performing Test HAS_CPP14_FLAG
— Performing Test HAS_CPP14_FLAG – Success
— pybind11 v2.2.0
— Performing Test HAS_FLTO
— Performing Test HAS_FLTO – Success
— LTO enabled
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
Boost_INCLUDE_DIR (ADVANCED)
Through Googling, I found a message thread talking about using conda to install instead. I hadn’t realized it was a conda package! I tried
conda install -c conda-forge dionysus
instead — and there I learned many things! It listed many packages to download or upgrade, and then
The following packages will be DOWNGRADED:
pillow: 3.3.0-py34_0 –> 3.2.0-py27_0conda-forge
pyqt: 4.11.4-py34_4–> 4.11.4-py27_2 conda-forge
python: 3.4.5-0–> 2.7.14-0conda-forge
python.app: 1.2-py34_4 –> 1.2-py27_0conda-forge
Proceed ([y]/n)? n
What? It wants to downgrade my Python version? Is this the whole problem?!
I switched environments to my Python 2.7 install and repeated
conda install -c conda-forge dionysus
and it installed with no problem.
Had to remind myself that for my Python 2.7 install, I use “ipython notebook” to make new notebooks, rather than “jupyter notebook”, but after that I was able to interact with Dionysus 2 and run all the examples from the tutorial.
So, that’s my story. Maybe there’s a Boost problem, a path problem, whatever, but I think the real problem is that Dionysus 2 is built for Python 2.7 not Python 3.*, and so I’ll just have to make full use of the Anaconda distributions easy environment-switching. This Python version issue is not noted anywhere I saw online.