sgoldenlab / simba

SimBA (Simple Behavioral Analysis), a pipeline and GUI for developing supervised behavioral classifiers
https://simba-uw-tf-dev.readthedocs.io/
GNU General Public License v3.0
289 stars 140 forks source link

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

Open bancroftg opened 2 hours ago

bancroftg commented 2 hours ago

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'

sronilsson commented 2 hours ago

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

bancroftg commented 1 hour ago

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 commented 1 hour ago

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 commented 1 hour ago

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 commented 1 hour ago

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 commented 1 hour ago

I get the same error with the 'dtreeviz' module

sronilsson commented 59 minutes ago

what do you see if you do pip show pip ?

bancroftg commented 58 minutes ago

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: distutils-sig@python.org License: MIT

sronilsson commented 49 minutes ago

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 commented 45 minutes ago

Python 3.6.13 Anaconda Navigator 2.5.3

sronilsson commented 32 minutes ago

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

bancroftg commented 31 minutes ago

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: sronilsson@gmail.com 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 commented 24 minutes ago

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?