brinckmann / montepython_public

Public repository for the Monte Python Code
MIT License
92 stars 78 forks source link

AttributeError: module 'clik' has no attribute 'lkl' #352

Closed raj1996cool closed 6 months ago

raj1996cool commented 7 months ago

python montepython/MontePython.py run -o chains/PA -p input/base2018TTTEEE.param --conf default.conf --superupdate 50 -N 400000 /!\ PyMultiNest detected but MultiNest likely not installed correctly. You can safely ignore this if not running with option -m NS Running Monte Python v3.6.0

with CLASS v3.2.1 /!\ Running CLASS from a non version-controlled repository

Testing likelihoods for: ->Planck_highl_TTTEEE, Planck_lowl_EE, Planck_lowl_TT

Cannot use clik wrapper (cause = '/home/raj/Documents/code/montepython_public-3.6/planck/code/plc_3.0/plc-3.01/lib/python/site-packages/clik/lkl.so: undefined symbol: _Py_ZeroStruct') Cannot use clik_lensing wrapper (cause = '/home/raj/Documents/code/montepython_public-3.6/planck/code/plc_3.0/plc-3.01/lib/python/site-packages/clik/lkl_lensing.so: undefined symbol: _Py_ZeroStruct') Traceback (most recent call last): File "/home/raj/Documents/code/montepython_public-3.6/montepython/likelihood_class.py", line 893, in init self.clik = clik.clik(self.path_clik) AttributeError: module 'clik' has no attribute 'clik'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/raj/Documents/code/montepython_public-3.6/montepython/MontePython.py", line 40, in sys.exit(run()) File "/home/raj/Documents/code/montepython_public-3.6/montepython/run.py", line 31, in run cosmo, data, command_line, success = safe_initialisation( File "/home/raj/Documents/code/montepython_public-3.6/montepython/run.py", line 191, in safe_initialisation cosmo, data, command_line, success = initialise(custom_command) File "/home/raj/Documents/code/montepython_public-3.6/montepython/initialise.py", line 67, in initialise data = Data(command_line, path) File "/home/raj/Documents/code/montepython_public-3.6/montepython/data.py", line 362, in init self.initialise_likelihoods(self.experiments) File "/home/raj/Documents/code/montepython_public-3.6/montepython/data.py", line 497, in initialise_likelihoods exec("self.lkl['%s'] = %s('%s/%s.data',\ File "", line 1, in File "/home/raj/Documents/code/montepython_public-3.6/montepython/likelihood_class.py", line 895, in init except clik.lkl.CError: AttributeError: module 'clik' has no attribute 'lkl'

deSitter2 commented 7 months ago

I am facing the same issue, even I tried a fresh plc_3.0 installation.

Cannot use clik wrapper (cause = 'No module named 'clik.lkl'') Cannot use clik_lensing wrapper (cause = 'No module named 'clik.lkl_lensing'') Traceback (most recent call last): File "/home/user/Desktop/montepython_public-3.6.0/montepython/likelihood_class.py", line 893, in init self.clik = clik.clik(self.path_clik) ^^^^^^^^^ AttributeError: module 'clik' has no attribute 'clik'

if anybody can help, I will be very thankful to you! Thanks in advance.

brinckmann commented 6 months ago

Hi,

It looks like your Planck installation wasn't done correctly or isn't properly sourced, you'll want to make sure that's working first before trying something more complicated like running a sampler. This is not a MontePython issue. Here are ways to get further information on installing Planck:

Best, Thejs

deSitter2 commented 4 months ago

I think the issue is with the Python distribution, as I was using python3.11, this click error persisted, but then I downgraded the python3.11 to python3.8, everything is working fine now.

brinckmann commented 4 months ago

Thank you for reporting back on this, that is very useful and appreciated!

Best, Thejs

NightRunner7 commented 4 months ago

II have a very specific problem. Even when using the newest Python releases (Python 3.11), the issue persists. However, after downgrading Python to version 3.8, the errors disappeared - may be an incompatibility issue between Click and the newest Python releases.

Best regards, Krzysztof