Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simba install issue: No module named 'dtreeviz' #393

Open
bancroftg opened this issue Sep 25, 2024 · 13 comments
Open

Simba install issue: No module named 'dtreeviz' #393

bancroftg opened this issue Sep 25, 2024 · 13 comments

Comments

@bancroftg
Copy link

These are the steps I used to install simba through Anaconda: https://github.com/sgoldenlab/simba/blob/master/docs/anaconda_installation.md

This was the output when I attempted to run simba:
Traceback (most recent call last):
File "C:\Users\Eisch Lab.conda\envs\simba\lib\site-packages\simba\mixins\train_model_mixin.py", line 42, in
from dtreeviz.trees import dtreeviz, tree
ModuleNotFoundError: No module named 'dtreeviz'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\Eisch Lab.conda\envs\simba\lib\runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "C:\Users\Eisch Lab.conda\envs\simba\lib\runpy.py", line 85, in run_code
exec(code, run_globals)
File "C:\Users\Eisch Lab.conda\envs\simba\Scripts\simba.exe_main
.py", line 4, in
File "C:\Users\Eisch Lab.conda\envs\simba\lib\site-packages\simba\SimBA.py", line 28, in
from simba.model.grid_search_rf import GridSearchRandomForestClassifier
File "C:\Users\Eisch Lab.conda\envs\simba\lib\site-packages\simba\model\grid_search_rf.py", line 11, in
from simba.mixins.train_model_mixin import TrainModelMixin
File "C:\Users\Eisch Lab.conda\envs\simba\lib\site-packages\simba\mixins\train_model_mixin.py", line 44, in
import dtreeviz
ModuleNotFoundError: No module named 'dtreeviz'

  • OS: [Windows 10]
  • Python Version [3.6]
  • Are you using anaconda? yes
@sronilsson
Copy link
Collaborator

Thanks for reporting @bancroftg - if you run pip install dtreeviz==0.8.1, and the try to launch simba, how does it look?

@bancroftg
Copy link
Author

I ran the suggested code with the following result:
Requirement already satisfied: dtreeviz==0.8.1 in c:\users\eisch lab.conda\envs\simba\lib\site-packages (0.8.1)
Requirement already satisfied: matplotlib in c:\users\eisch lab.conda\envs\simba\lib\site-packages (from dtreeviz==0.8.1) (3.3.4)
Requirement already satisfied: graphviz>=0.9 in c:\users\eisch lab.conda\envs\simba\lib\site-packages (from dtreeviz==0.8.1) (0.11)
Requirement already satisfied: scikit-learn in c:\users\eisch lab.conda\envs\simba\lib\site-packages (from dtreeviz==0.8.1) (0.22.2)
Requirement already satisfied: numpy in c:\users\eisch lab.conda\envs\simba\lib\site-packages (from dtreeviz==0.8.1) (1.19.5)
Requirement already satisfied: colour in c:\users\eisch lab.conda\envs\simba\lib\site-packages (from dtreeviz==0.8.1) (0.1.5)
Requirement already satisfied: pandas in c:\users\eisch lab.conda\envs\simba\lib\site-packages (from dtreeviz==0.8.1) (0.25.3)
Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.3 in c:\users\eisch lab.conda\envs\simba\lib\site-packages (from matplotlib->dtreeviz==0.8.1) (3.1.4)
Requirement already satisfied: kiwisolver>=1.0.1 in c:\users\eisch lab.conda\envs\simba\lib\site-packages (from matplotlib->dtreeviz==0.8.1) (1.3.1)
Requirement already satisfied: pillow>=6.2.0 in c:\users\eisch lab.conda\envs\simba\lib\site-packages (from matplotlib->dtreeviz==0.8.1) (8.3.2)
Requirement already satisfied: python-dateutil>=2.1 in c:\users\eisch lab.conda\envs\simba\lib\site-packages (from matplotlib->dtreeviz==0.8.1) (2.9.0.post0)
Requirement already satisfied: cycler>=0.10 in c:\users\eisch lab.conda\envs\simba\lib\site-packages (from matplotlib->dtreeviz==0.8.1) (0.11.0)
Requirement already satisfied: six>=1.5 in c:\users\eisch lab.conda\envs\simba\lib\site-packages (from python-dateutil>=2.1->matplotlib->dtreeviz==0.8.1) (1.16.0)
Requirement already satisfied: pytz>=2017.2 in c:\users\eisch lab.conda\envs\simba\lib\site-packages (from pandas->dtreeviz==0.8.1) (2024.2)
Requirement already satisfied: scipy>=0.17.0 in c:\users\eisch lab.conda\envs\simba\lib\site-packages (from scikit-learn->dtreeviz==0.8.1) (1.5.4)
Requirement already satisfied: joblib>=0.11 in c:\users\eisch lab.conda\envs\simba\lib\site-packages (from scikit-learn->dtreeviz==0.8.1) (1.1.1)

And then tried to run simba:
Traceback (most recent call last):
File "C:\Users\Eisch Lab.conda\envs\simba\lib\site-packages\simba\mixins\train_model_mixin.py", line 42, in
from dtreeviz.trees import dtreeviz, tree
ModuleNotFoundError: No module named 'dtreeviz'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\Eisch Lab.conda\envs\simba\lib\runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "C:\Users\Eisch Lab.conda\envs\simba\lib\runpy.py", line 85, in run_code
exec(code, run_globals)
File "C:\Users\Eisch Lab.conda\envs\simba\Scripts\simba.exe_main
.py", line 4, in
File "C:\Users\Eisch Lab.conda\envs\simba\lib\site-packages\simba\SimBA.py", line 28, in
from simba.model.grid_search_rf import GridSearchRandomForestClassifier
File "C:\Users\Eisch Lab.conda\envs\simba\lib\site-packages\simba\model\grid_search_rf.py", line 11, in
from simba.mixins.train_model_mixin import TrainModelMixin
File "C:\Users\Eisch Lab.conda\envs\simba\lib\site-packages\simba\mixins\train_model_mixin.py", line 44, in
import dtreeviz
ModuleNotFoundError: No module named 'dtreeviz'

@sronilsson
Copy link
Collaborator

If you (i) uninstall it with pip uninstall dtreeviz, (ii) confirm that it is no longer in your conda evironment with pip show dtreeviz showing no version printed out, and (iii) finally reinstall it with pip install dtreeviz==0.8.1?

@bancroftg
Copy link
Author

When doing step (iii) I got this error message:

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
simba-uw-tf-dev 2.1.9 requires numpy==1.19.1; python_version == "3.6", but you have numpy 1.19.5 which is incompatible.
simba-uw-tf-dev 2.1.9 requires shapely==1.8.0; python_version == "3.6", but you have shapely 1.7.1 which is incompatible.
Successfully installed dtreeviz-0.8.1

Could this be part of the issue?

@sronilsson
Copy link
Collaborator

sronilsson commented Sep 25, 2024

I am not sure, but there seems to be some version clashes with other packages.

If you createa new conda python 3.6 environment, and only go to step 6 (i.e., pip install simba-uw-tf-dev) followed by launching with simba, how does it look?

@bancroftg
Copy link
Author

I get the same error with the 'dtreeviz' module

@sronilsson
Copy link
Collaborator

what do you see if you do pip show pip ?

@bancroftg
Copy link
Author

Name: pip
Version: 21.2.2
Summary: The PyPA recommended tool for installing Python packages.
Home-page: https://pip.pypa.io/
Author: The pip developers
Author-email: [email protected]
License: MIT

@sronilsson
Copy link
Collaborator

I gave it a go and installed it and I couldn't recreate the error...

What version of the Anaconda Navigator do you have?

And, what exact version of python python --version ?

@bancroftg
Copy link
Author

Python 3.6.13
Anaconda Navigator 2.5.3

@sronilsson
Copy link
Collaborator

one morequestion, what do you see with pip show simba-uw-tf-dev ?

@bancroftg
Copy link
Author

Name: Simba-UW-tf-dev
Version: 2.1.9
Summary: Toolkit for computer classification and analysis of behaviors in experimental animals
Home-page: https://github.com/sgoldenlab/simba
Author: Simon Nilsson, Jia Jie Choong, Sophia Hwang
Author-email: [email protected]
License: GNU General Public License v3 (GPLv3)
Location: c:\users\eisch lab.conda\envs\simba\lib\site-packages
Requires: dash, pyglet, pyvis, psutil, imutils, kaleido, dash-core-components, joblib, shap, seaborn, numba, trafaret, scipy, scikit-learn, statsmodels, xgboost, dash-html-components, h5py, pandas, tables, scikit-image, shapely, imbalanced-learn, dash-colorscales, tqdm, dash-color-picker, eli5, cefpython3, pyarrow, Pillow, opencv-python, dtreeviz, xlrd, plotly, geos, imgaug, tabulate, numpy, ffmpeg-python, pyyaml, openpyxl, matplotlib, numexpr, yellowbrick, graphviz
Required-by:

@sronilsson
Copy link
Collaborator

You have all the same versions that I just installed 😬 Except I have anaconda navigator
2.6.0 but that seems like a big reach that that would be relevant.... not sure what is going on.

Can you show me a screengarb from when you type pip install simba-uw-tf-dev in a fresh conda python 3.6.13 environment, what is printed out?

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

No branches or pull requests

2 participants