montepython_public
montepython_public copied to clipboard
import error with class
I am trying to install MontePython. after installing class with make -j I tried to see whether the python wrapper of class is working or not. I typed the following command from classy import Class and I got the following error
Traceback (most recent call last):
File "
I am using the latest 2.6 version of class.
Hi, I'm not quite sure what is causing the issue, but to narrow it down can you please make sure that everything is installed for, compiled with and being run with Python 2.7, and not Python 3 (i.e. scipy, numpy, cython and the CLASS wrapper)? The CLASS wrapper itself should be compatible with Python 3, but since you want to run it with MontePython, you will need it compiled with Python 2 for that. Regards, Thejs
It is a known issue. See last comment in https://github.com/lesgourg/class_public/issues/99
In class folder, in python/setup.py, I had to change the line
libraries=["class"],
to
libraries=["class", "mvec", "m"],
to explicitly link those libraries.