California-Planet-Search / radvel

General Toolkit for Modeling Radial Velocity Data
http://radvel.readthedocs.io
MIT License
57 stars 52 forks source link

AttributeError: module `radvel` has no attribute `likelihood` #291

Closed rndev2017 closed 4 years ago

rndev2017 commented 4 years ago

I have just recently tried using this library. I was looking at the code in the tutorial and running it in my Jupyter notebook environment on my Windows 10 laptop. However, when I ran this line of code df = radvel.mcmc(post, nwalkers=20, nrun=400 or like = radvel.likelihood.RVLikelihood(model, x, y, err), I keep getting the following error: AttributeError: module radvel has no attribute likelihood.

If someone can please help me out with this, it would be greatly appreciated!

rndev2017 commented 4 years ago

I'm using Python 3.6.2 if that helps.

bjfultn commented 4 years ago

Which tutorial are you running through? The K2-24 one in the advanced usage section?

rndev2017 commented 4 years ago

Yes the K2-24 tutorial. Sorry for late response.

bjfultn commented 4 years ago

OK, I just verified that the tutorial notebook is running fine for me. I have a few more questions to help me debug.

Did you have any trouble with installing it via pip? Is this the first and only install of radvel on your machine? Are you running the notebook directly by downloading it from here: https://github.com/California-Planet-Search/radvel/blob/master/docs/tutorials/K2-24_Fitting%2BMCMC.ipynb

rndev2017 commented 4 years ago

This isn't the first time I've installed it on my device. I used it in Jupyter notebook oger rhe summer. And I copied the lines from that file.

bjfultn commented 4 years ago

Ok, I recommend re-installing radvel and all of it's dependencies in a fresh anaconda environment (assuming you are using anaconda).

Also make sure that you are not explicitly putting any radvel-related paths in your system or anaconda PYTHONPATH environment variable.

Then try to run that linked notebook.

rndev2017 commented 4 years ago

Ok thank you for your help!

bjfultn commented 4 years ago

No problem, let me know how that goes.

rndev2017 commented 4 years ago

I created a fresh virtual environment and reinstalled radvel however the issue persists. Am I doing something incorrectly?

bjfultn commented 4 years ago

Are you able to explicitly import radvel.likelihood? import radvel.likelihood Can you get through the command line example without errors? https://radvel.readthedocs.io/en/latest/quickstartcli.html#example-fit

rndev2017 commented 4 years ago

Hey, explicitly importing as you suggested actually fixed the problem. Thank you so much for your help!

bjfultn commented 4 years ago

Great! I updated the tutorials to include this line and the changes will be released in the next version.