Skip to content
This repository has been archived by the owner on Sep 15, 2021. It is now read-only.

ImportError after installation #1123

Open
vshiv18 opened this issue Jun 29, 2019 · 9 comments
Open

ImportError after installation #1123

vshiv18 opened this issue Jun 29, 2019 · 9 comments

Comments

@vshiv18
Copy link

vshiv18 commented Jun 29, 2019

After installation on MacOS 10.14.1, with miniconda, using the command conda install -c omnia msmbuilder, I am getting an ImportError: No module named grid_search.

Here is the full traceback from running msmb -h:

Traceback (most recent call last):
File "/Users/vikram/miniconda3/bin/msmb", line 4, in
import msmbuilder.scripts.msmb
File "/Users/vikram/miniconda3/lib/python2.7/site-packages/msmbuilder/scripts/msmb.py", line 5, in
from ..commands import *
File "/Users/vikram/miniconda3/lib/python2.7/site-packages/msmbuilder/commands/init.py", line 5, in
from .example_datasets import AlanineDipeptideDatasetCommand
File "/Users/vikram/miniconda3/lib/python2.7/site-packages/msmbuilder/commands/example_datasets.py", line 4, in
from ..example_datasets import (AlanineDipeptide, DoubleWell, QuadWell, FsPeptide,
File "/Users/vikram/miniconda3/lib/python2.7/site-packages/msmbuilder/example_datasets/init.py", line 3, in
from .brownian1d import DoubleWell, QuadWell
File "/Users/vikram/miniconda3/lib/python2.7/site-packages/msmbuilder/example_datasets/brownian1d.py", line 17, in
from ..msm import _solve_msm_eigensystem
File "/Users/vikram/miniconda3/lib/python2.7/site-packages/msmbuilder/msm/init.py", line 2, in
from .core import *
File "/Users/vikram/miniconda3/lib/python2.7/site-packages/msmbuilder/msm/core.py", line 17, in
from ..utils import list_of_1d
File "/Users/vikram/miniconda3/lib/python2.7/site-packages/msmbuilder/utils/init.py", line 4, in
from .param_sweep import *
File "/Users/vikram/miniconda3/lib/python2.7/site-packages/msmbuilder/utils/param_sweep.py", line 3, in
from sklearn.grid_search import ParameterGrid
ImportError: No module named grid_search

I am using a Miniconda 3.7 installation, but also have python 3.6 and python 2.7 installed on my machine. I freshly installed miniconda to install MSMbuilder, so it is the latest version.

@vshiv18 vshiv18 changed the title ImportError after instillation ImportError after installation Jun 29, 2019
@jstoppelman
Copy link

Hello, I am receiving a similar issue after installing MSMBuilder 3.8.0 from conda install -c omnia msmbuilder and trying to import msmbuilder.cluster into my code with from msmbuilder import cluster. I believe sklearn.grid_search has been removed in favor of sklearn.model_selection, and I think this is causing the error. I'm not entirely certain though.

@salotz
Copy link

salotz commented Jul 30, 2019

Same thing here. Should be an easy fix just changing the import, might try to do it myself. I've heard from the old maintainers that no one is maintaining the project anymore.

@salotz
Copy link

salotz commented Jul 31, 2019

Actually, this is addressed in the code, its just not in the build. https://github.com/msmbuilder/msmbuilder/blob/master/msmbuilder/utils/param_sweep.py#L3
They would need to do a new release and publish to PyPI. I tried installing directly from the source tree:

pip install git+https://github.com/msmbuilder/msmbuilder.git

But I get all kinds of compiler errors...

Here is the full listing of commands I run to do this in a fresh env:

env_name="msmbuilder-dev"
conda deactivate
conda create -y -n "$env_name" python=3
conda activate "$env_name"
# build dependencies
conda install -y -c conda-forge cython=0.27.3 numpy mdtraj=1.8
# runtime dependencies
conda install -y -c conda-forge scipy scikit-learn numpydoc pytables pyhmc pyyaml jinja2 fastcluster
pip install git+https://github.com/msmbuilder/msmbuilder.git

And the full output with extra info in the fancy shell prompt:

msmbuilder_build_failure.txt

$ gcc --version
gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

@salotz
Copy link

salotz commented Jul 31, 2019

I am able to build on my machine if I use the 3.8.0 commit tag:

pip install git+https://github.com/msmbuilder/msmbuilder.git@3.8.0

But the fix happened recently: 8c901a3

My fork resets back to 3.8.0 so I can build it and then makes the necessary fixes (for me to run KCenters at least, I haven't run the tests): https://github.com/salotz/msmbuilder

@rmcgibbo
Copy link
Contributor

is there a issue open for the build failure? it looks like it might be a issue related to a newer version of cython.

@salotz
Copy link

salotz commented Aug 1, 2019

I don't know if I am building properly as I wasn't able to find a comprehensive guide, just wanted to share my workaround give as much info as I had so I didn't want to raise that as an issue. I just installed the packages from conda-forge as they are specified in the up to date meta.yaml file which uses an older cython 0.27.3 https://github.com/msmbuilder/msmbuilder/blob/master/devtools/conda-recipe/meta.yaml#L19 so I don't think it is that.

@rmcgibbo
Copy link
Contributor

rmcgibbo commented Aug 3, 2019

@salotz: with cython==0.24, I get errors like that when running pip install git+https://github.com/msmbuilder/msmbuilder.git, but after doing a pip install Cython==0.28 -U -I, the msmbuilder installation from git+https:// works.

@salotz
Copy link

salotz commented Aug 5, 2019

Works for me now too. I installed with the latest cython from conda-forge (0.29.13). Should've tried that first. Thanks @rmcgibbo.

@momarzouksobeh
Copy link

I don't know if I am building properly as I wasn't able to find a comprehensive guide, just wanted to share my workaround give as much info as I had so I didn't want to raise that as an issue. I just installed the packages from conda-forge as they are specified in the up to date meta.yaml file which uses an older cython 0.27.3 https://github.com/msmbuilder/msmbuilder/blob/master/devtools/conda-recipe/meta.yaml#L19 so I don't think it is that.

I am trying to compute Implied time scale but I have this error

/misc/home/marzouk/anaconda3/envs/msmbuilder/lib/python3.6/site-packages/sklearn/externals/joblib/init.py:15: DeprecationWarning: sklearn.externals.joblib is deprecated in 0.21 and will be removed in 0.23. Please import this functionality directly from joblib, which can be installed with: pip install joblib. If this warning is raised when loading pickled models, you may need to re-serialize those models with scikit-learn 0.21+.
warnings.warn(msg, category=DeprecationWarning)
An unexpected error has occurred with MSMBuilder (version 3.8.0), please
consider sending the following traceback to MSMBuilder GitHub issue tracker at:
https://github.com/msmbuilder/msmbuilder/issues

Traceback (most recent call last):
File "/misc/home/marzouk/anaconda3/envs/msmbuilder/bin/msmb", line 6, in
sys.exit(msmbuilder.scripts.msmb.main())
File "/misc/home/marzouk/anaconda3/envs/msmbuilder/lib/python3.6/site-packages/msmbuilder/scripts/msmb.py", line 28, in main
app.start()
File "/misc/home/marzouk/anaconda3/envs/msmbuilder/lib/python3.6/site-packages/msmbuilder/cmdline.py", line 464, in start
instance.start()
File "/misc/home/marzouk/anaconda3/envs/msmbuilder/lib/python3.6/site-packages/msmbuilder/commands/implied_timescales.py", line 101, in start
verbose=self.args.verbose)
File "/misc/home/marzouk/anaconda3/envs/msmbuilder/lib/python3.6/site-packages/msmbuilder/msm/implied_timescales.py", line 48, in implied_timescales
verbose=verbose)
File "/misc/home/marzouk/anaconda3/envs/msmbuilder/lib/python3.6/site-packages/msmbuilder/utils/param_sweep.py", line 37, in param_sweep
param_grid = ParameterGrid(param_grid)
NameError: name 'ParameterGrid' is not defined

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants