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
272 stars 137 forks source link

Trouble installing simba #368

Open GKNM995 opened 4 days ago

GKNM995 commented 4 days ago

I have followed instructions to install Simba using Anaconda but repeatedly see this error message:

(simba) C:\Users\gabie>simba Traceback (most recent call last): File "C:\Users\gabie.conda\envs\simba\lib\runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "C:\Users\gabie.conda\envs\simba\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "C:\Users\gabie.conda\envs\simba\Scripts\simba.exe__main__.py", line 4, in File "C:\Users\gabie.conda\envs\simba\lib\site-packages\simba\SimBA.py", line 17, in from tabulate import tabulate ModuleNotFoundError: No module named 'tabulate'

Installing dependencies manually, using different python versions, installing Shapely first then simba without tf, and other fixes suggested before did not fix the issue. When I check which packages are installed, tabulate is always present:

(simba) C:\Users\gabie>conda list

packages in environment at C:\Users\gabie.conda\envs\simba:

#

Name Version Build Channel

attrs 22.2.0 pypi_0 pypi blas 1.0 mkl brotli 1.1.0 pypi_0 pypi cefpython3 66.0 pypi_0 pypi certifi 2021.5.30 py36haa95532_0 click 8.0.4 pypi_0 pypi cloudpickle 2.2.1 pypi_0 pypi colorama 0.4.5 pypi_0 pypi colour 0.1.5 pypi_0 pypi cycler 0.11.0 pypi_0 pypi dash 1.14.0 pypi_0 pypi dash-color-picker 0.0.1 pypi_0 pypi dash-colorscales 0.0.4 pypi_0 pypi dash-core-components 1.10.2 pypi_0 pypi dash-html-components 1.0.3 pypi_0 pypi dash-renderer 1.6.0 pypi_0 pypi dash-table 4.9.0 pypi_0 pypi dask 2021.3.0 pypi_0 pypi dataclasses 0.8 pypi_0 pypi decorator 4.4.2 pypi_0 pypi dtreeviz 0.8.1 pypi_0 pypi eli5 0.10.1 pypi_0 pypi flask 2.0.3 pypi_0 pypi flask-compress 1.15 pypi_0 pypi future 1.0.0 pypi_0 pypi geos 3.8.0 h33f27b4_0 h5py 2.9.0 pypi_0 pypi imageio 2.9.0 pypi_0 pypi imbalanced-learn 0.6.2 pypi_0 pypi imblearn 0.0 pypi_0 pypi imgaug 0.4.0 pypi_0 pypi importlib-metadata 4.8.3 pypi_0 pypi imutils 0.5.2 pypi_0 pypi intel-openmp 2023.1.0 h59b6b97_46320 itsdangerous 2.0.1 pypi_0 pypi jinja2 3.0.3 pypi_0 pypi joblib 1.1.1 pypi_0 pypi kiwisolver 1.3.1 pypi_0 pypi llvmlite 0.31.0 pypi_0 pypi markupsafe 2.0.1 pypi_0 pypi matplotlib 3.0.3 pypi_0 pypi mkl 2020.2 256 mkl-service 2.3.0 py36h196d8e1_0 mkl_fft 1.3.0 py36h46781fe_0 mkl_random 1.1.1 py36h47e9c7a_0 networkx 2.5.1 pypi_0 pypi numba 0.48.0 pypi_0 pypi numexpr 2.6.9 pypi_0 pypi numpy 1.18.1 pypi_0 pypi opencv-python 3.4.5.20 pypi_0 pypi pandas 0.25.3 pypi_0 pypi pillow 5.4.1 pypi_0 pypi pip 21.2.2 py36haa95532_0 plotly 4.9.0 pypi_0 pypi pyarrow 0.17.1 pypi_0 pypi pyparsing 3.1.2 pypi_0 pypi python 3.6.13 h3758d61_0 python-dateutil 2.9.0.post0 pypi_0 pypi python-graphviz 0.11 pypi_0 pypi pytz 2024.1 pypi_0 pypi pywavelets 1.1.1 pypi_0 pypi pyyaml 5.3.1 pypi_0 pypi retrying 1.3.4 pypi_0 pypi scikit-image 0.14.2 pypi_0 pypi scikit-learn 0.22.2 pypi_0 pypi scipy 1.1.0 pypi_0 pypi seaborn 0.9.0 pypi_0 pypi setuptools 58.0.4 py36haa95532_0 shap 0.35.0 pypi_0 pypi shapely 1.7.1 py36h06580b3_0 simba-uw-no-tf 1.3.0 pypi_0 pypi six 1.16.0 pyhd3eb1b0_1 sqlite 3.45.3 h2bbff1b_0 statsmodels 0.9.0 pypi_0 pypi tabulate 0.8.3 pypi_0 pypi toolz 0.12.0 pypi_0 pypi tqdm 4.30.0 pypi_0 pypi typing-extensions 4.1.1 pypi_0 pypi vc 14.2 h2eaa2aa_1 vs2015_runtime 14.29.30133 h43f2093_3 werkzeug 2.0.3 pypi_0 pypi wheel 0.37.1 pyhd3eb1b0_0 wincertstore 0.2 py36h7fe50ca_0 wxpython 4.0.4 pypi_0 pypi xgboost 0.90 pypi_0 pypi yellowbrick 0.9.1 pypi_0 pypi zipp 3.6.0 pypi_0 pypi zstandard 0.20.0 pypi_0 pypi

I am using Windows 10 and python 3.6.13. Thanks for your help!

sronilsson commented 4 days ago

Hi @GKNM995 - not completely sure what is going on, but appear tabulate is missing or SimBA can't find it in your conda environment. It could possibly related to installing different simba versions in the same environment?

What command did you use to install SimBA? Did you use pip install simba-uw-tf-dev ?

GKNM995 commented 4 days ago

Hi! I used pip install simba-uw-tf-dev. I only installed it once in this environment.

sronilsson commented 4 days ago

if you do conda activate simba and open a python in the environment and import tabulate does it import OK like below?

Just trying to figure out if issue is with python environment or with simba:

image
GKNM995 commented 4 days ago

It does not. I get an error message. Screenshot 2024-06-28 150053

sronilsson commented 4 days ago

Alright: what if you run pip install tabulate==0.8.3 and then open python with python and try again?

GKNM995 commented 4 days ago

I tried to install it as instructed but conda wouldn't let me, so I uninstalled, then reinstalled it. Weirdly, it prints the same error message as before. Screenshot 2024-06-28 151145

sronilsson commented 4 days ago

Yes, I see that a different version of simba is installed in the same environment: simba-uw-no-tf. I would try in a new conda environment. Or, alternatively, do pip uninstall simba-uw-no-tf and then try again?

GKNM995 commented 4 days ago

Got rid of the old environment and did the following:

conda create --name simba python=3.6 conda activate simba pip install simba-uw-tf-dev pip uninstall shapely conda install shapely simba

I get the same error. Screenshot 2024-06-28 153258

sronilsson commented 4 days ago

And now, if you run pip install tabulate==0.8.3 and then open python with python and try again with import tabulate?

GKNM995 commented 4 days ago

This is what happens (if I don't uninstall it before trying to install): Screenshot 2024-06-28 154448

GKNM995 commented 4 days ago

This happens if I uninstall then reinstall it: Screenshot 2024-06-28 154650

sronilsson commented 4 days ago

Nuts :) Sorry, I have to get back to you - I have to step away from the computer for now.

GKNM995 commented 4 days ago

Ok. Gonna step away from it as well

sronilsson commented 3 days ago

I tried a few ways to recreate error but I've failed and not come across this before.

Could there be some clash between the main python and python in the conda environment?

E.g., if you do conda deactivate and step out of conda env, then type pip install tabulate==0.8.3, and open main python with python, can you then import tabulate ? If tabulate is installed in the main python, is it also found in the conda simba environment?

If none of the above makes anything clearer, can you tell me which versions of setuptools (pip show setuptools), pip, (pip show pip) and conda (conda --version) you have and I can make sure I have the same setup as you when testing?

`

GKNM995 commented 3 days ago

When I install tabulate in base conda, I still can't import it for some reason (see screenshot). However, it is listed as intalled in both the base conda and simba environments. Screenshot 2024-06-29 122151

Here are the versions I am using: Conda version: 24.3.0 Setuptools: 58.0.4 pip: 21.3.1

sronilsson commented 2 days ago

Hi @GKNM995 - from the screenshot, it looks like tabulate DOES install correctly in the base environment. However, in your base environment, you have python 3.10, and you are installing a specific version of tabulate that does not fit with collections package which comes with base python 3.10.

You can try with just pip install tabulate to get the latest version and I suspect it will work in base.

The only thing that is different from my test environment is the conda version, I have 23.3.1.

How about THIS suggestion? If you install tabulate with conda install -c conda-forge tabulate in your simba conda environment - does that change anything?

GKNM995 commented 52 minutes ago

You were right! Tabulate was successfully imported into the base environment when I reinstalled it. It was also successfully installed in the simba environment. image

However, I got new errors: image I manually installed dtreeviz, and it was installed as well.

Then this happened: image

Not sure how to proceed from here. Thank you so much for your help!