hackingmaterials / automatminer

An automatic engine for predicting materials properties.
Other
138 stars 50 forks source link

VERSION FileNotFoundError on import #223

Closed janosh closed 5 years ago

janosh commented 5 years ago

After trying both pip install automatminer and installing from source (pip install git+https://github.com/hackingmaterials/automatminer), importing as

import automatminer as amm

throws the error

FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/Caskroom/miniconda/base/envs/thermo/lib/python3.6/site-packages/automatminer/../VERSION'

Commenting out the lines handling the version number in __init__.py solves this problem but obviously isn't a good solution.

import os

from automatminer.automl import TPOTAdaptor
from automatminer.featurization import AutoFeaturizer
from automatminer.pipeline import MatPipe
from automatminer.preprocessing import DataCleaner, FeatureReducer
from automatminer.presets import get_preset_config

__author__ = "Alex Dunn, Qi Wang, Alex Ganose, Alireza Faghaninia, Anubhav Jain"
__author_email__ = "ardunn@lbl.gov"
__license__ = "Modified BSD"

# with open(os.path.join(os.path.dirname(os.path.abspath(__file__)), "../VERSION"), "r") as f:
#    version = f.read()
#__version__ = version
ardunn commented 5 years ago

Hi @janosh,

Thanks for pointing out this issue. Been fixed and a new version 2019.9.12 has been released, so you should now be able to install from pip, e.g., pip install automatminer.

This fix aside, you should be able to install by git clone + `pip install -e ." (if all else fails!).

Thanks, Alex