lesgourg / class_public

Public repository of the Cosmic Linear Anisotropy Solving System (master for the most recent version of the standard code; GW_CLASS to include Cosmic Gravitational Wave Background anisotropies; classnet branch for acceleration with neutral networks; ExoCLASS branch for exotic energy injection; class_matter branch for FFTlog)
223 stars 292 forks source link

Isuue in importing Python Wrapper (CLASS) #469

Open saadkamranok opened 2 years ago

saadkamranok commented 2 years ago

i am trying to use CLASS python wrapper for Monte python but when i try to import it, shows this error. i am using ubuntu 18 operating system and python 2.7 from anaconda2.

from classy import Class Traceback (most recent call last): File "", line 1, in ImportError: /home/saad/.local/lib/python2.7/site-packages/classy.so: undefined symbol: _ZGVbN2v_sin

don't know what to do

ShazAlvi commented 2 years ago

Most likely there is a mixup of the python version i.e. you have compiled it with a different version of python and it's being called inside an environment based on a different python. I would first make sure that the two python versions are the same.

saadkamranok commented 2 years ago

Most likely there is a mixup of the python version i.e. you have compiled it with a different version of python and it's being called inside an environment based on a different python. I would first make sure that the two python versions are the same.

@ShazAlvi thanks for your response but when i type python --version it shows me the one with anaconda like this.

~$ python Python 2.7.13 |Anaconda 4.4.0 (64-bit)| (default, Dec 20 2016, 23:09:15) [GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux2 Type "help", "copyright", "credits" or "license" for more information. Anaconda is brought to you by Continuum Analytics. Please check out: http://continuum.io/thanks and https://anaconda.org

from classy import Class Traceback (most recent call last): File "", line 1, in ImportError: /home/saad/.local/lib/python2.7/site-packages/classy.so: undefined symbol: _ZGVbN2v_sin

is there something i am missing ?

saadkamranok commented 2 years ago

Import problem is solved. i was using 2.6 version of class. now i install 3.1.1 (latest) and it is working . Thanks