timothydmorton / isochrones

Pythonic stellar model grid access; easy MCMC fitting of stellar properties
http://isochrones.readthedocs.org
MIT License
119 stars 63 forks source link

Can't install 1.0: AttributeError: 'module' object has no attribute '_base' #48

Closed elisabethadams closed 7 years ago

elisabethadams commented 7 years ago

Not sure why the installation is failing. I downloaded the data files by hand and moved them to ~/.isochrones, and for good measure uninstalled the older (0.9.1) version of isochrones that came bundled earlier using:

pip uninstall isochrones pip install isochrones

But the module doesn't load into python:


Python 2.7.12 |Anaconda 2.2.0 (x86_64)| (default, Jul 2 2016, 17:43:17) [GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)] on darwin 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

import isochrones Traceback (most recent call last): File "", line 1, in File "//anaconda/lib/python2.7/site-packages/isochrones/init.py", line 10, in from .isochrone import Isochrone, get_ichrone File "//anaconda/lib/python2.7/site-packages/isochrones/isochrone.py", line 2, in import pandas as pd File "//anaconda/lib/python2.7/site-packages/pandas/init.py", line 53, in from pandas.io.api import * File "//anaconda/lib/python2.7/site-packages/pandas/io/api.py", line 10, in from pandas.io.html import read_html File "//anaconda/lib/python2.7/site-packages/pandas/io/html.py", line 25, in import bs4 File "//anaconda/lib/python2.7/site-packages/bs4/init.py", line 30, in from .builder import builder_registry, ParserRejectedMarkup File "//anaconda/lib/python2.7/site-packages/bs4/builder/init.py", line 311, in from . import _html5lib File "//anaconda/lib/python2.7/site-packages/bs4/builder/_html5lib.py", line 57, in class TreeBuilderForHtml5lib(html5lib.treebuilders._base.TreeBuilder): AttributeError: 'module' object has no attribute '_base'

timothydmorton commented 7 years ago

Hmm.. seems like some sort of weird anaconda bug? I would try conda update all of the packages mentioned in this traceback and try again?

timothydmorton commented 7 years ago

also, for good measure (after updating the above---it looks like even import pandas wouldn't work), you might try to clone the current master version of 1.0; i think there have been a few bugfixes that haven't been released yet.

elisabethadams commented 7 years ago

So I got past those errors using conda update pandas

But then instead of just using emcee as advertised (I didn't have pymultinest installed), it failed to load the isochrones package:


import isochrones Traceback (most recent call last): File "", line 1, in File "//anaconda/lib/python2.7/site-packages/isochrones/init.py", line 11, in from .starmodel import StarModel File "//anaconda/lib/python2.7/site-packages/isochrones/starmodel.py", line 16, in import pymultinest ImportError: No module named pymultinest

And then when I tried to install pymultinest (pip install pymultinest) I got kicked out of python entirely with the error:


import isochrones problem: dlopen(libmultinest.dylib, 6): image not found

So I can dive into the weeds of getting pymultinest installed (it's not trivial), but would like to not have to...

(Documenting this in its entirety in case other people have the same issues...)

atw5179 commented 7 years ago

I know you don't want to install pymultinest if it isn't necessary, but I used these instructions to download it as I was finding problems when trying to download it any other way. These instructions installed everything perfectly for me http://astrobetter.com/wiki/MultiNest+Installation+Notes

elisabethadams commented 7 years ago

Hey, those notes worked! Except that there was a subtle, recent XCode bug that meant (upon consultation) that I needed to run the following command before running the astrobetter instructions:

sudo xcode-select --install
elisabethadams commented 7 years ago

Hi Tim,

I appreciate all the responses so far...

I have another nearly-final request to improve the documentation for those of us who are new to these particular packages -- how do I actually get numbers out? The documentation just says "The starfitscript will create an HDF5 file containing the saved StarModel, which you can load from python using StarModel.load_hdf, as well as triangle plots illustrating the fit." Which is all well and good if you are familiar with HDF5 files I suppose, but none of the demo notebooks show you how to get numbers out -- like, I can get a plot annotated with the median and 15/85% errors for the mass and radius of a star, but what's the function to return those numbers itself?

I tried poking in the code a bit but it's non-obvious and I lack the time I had as a grad student to keep digging. Thanks in advance!

Elisabeth

https://github.com/timothydmorton/isochrones/#attribution

On Tue, Jun 20, 2017 at 1:33 PM, atw5179 notifications@github.com wrote:

I know you don't want to install pymultinest if it isn't necessary, but I used these instructions to download it as I was finding problems when trying to download it any other way. These instructions installed everything perfectly for me http://astrobetter.com/wiki/ MultiNest+Installation+Notes

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/timothydmorton/isochrones/issues/48#issuecomment-309831639, or mute the thread https://github.com/notifications/unsubscribe-auth/ABi5Dhnlcw0pu98PyJAkJearV45YG9n1ks5sGAJogaJpZM4Nx_v0 .

timothydmorton commented 7 years ago

model = StarModel.load_hdf('filename.hdf') will give you back a StarModel object. Then you can access the samples table with model.samples. model.samples.columns will give you the names of all the columns, which you can access individually with model.samples['column'].