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
290 stars 141 forks source link

Crash when opening simba through command line #196

Closed yufang1039 closed 2 years ago

yufang1039 commented 2 years ago

Python 3.6 crash when I try to open Simba in command line. I'm using Mac OS Monterey 12.4. And I'm using anaconda for it and follow the exact the same instruction on your documentation page.

Thanks in advance for any help and here's the full error output.

Screen Shot 2022-07-11 at 2 13 31 PM
sronilsson commented 2 years ago

Hi @yufang1039! I had another user report what I think is a related issue not too long ago, although they were using an older macOS version. I am on Mac myself (12.4 (21F79)) and I have not been able to recreate this issue. I also did not see it in 12.3.1. My immediate thought was that it had something to do with running an older MacOS version, but your report suggests the issue is caused by something else.. see more info here faq entry 20 although it is not too much help: https://github.com/sgoldenlab/simba/blob/master/docs/FAQ.md#20-i-have-installed-simba-on-macos-when-i-try-to-launch-simba-by-typing-simba-i-get-a-long-error-message-which-ends-with-libcabidylib-terminating-with-uncaught-exception-of-type-nsexception-abort-trap-6 Could you check if it runs on python3.7?

yufang1039 commented 2 years ago

Hi @yufang1039! I had another user report what I think is a related issue not too long ago, although they were using an older macOS version. I am on Mac myself (12.4 (21F79)) and I have not been able to recreate this issue. I also did not see it in 12.3.1. My immediate thought was that it had something to do with running an older MacOS version, but your report suggests the issue is caused by something else.. see more info here faq entry 20 although it is not too much help: https://github.com/sgoldenlab/simba/blob/master/docs/FAQ.md#20-i-have-installed-simba-on-macos-when-i-try-to-launch-simba-by-typing-simba-i-get-a-long-error-message-which-ends-with-libcabidylib-terminating-with-uncaught-exception-of-type-nsexception-abort-trap-6 Could you check if it runs on python3.7?

Hi @sronilsson, I made few changes but then encounter new error message.

Changes I made:

  1. Open Xcode to agree few agreements.
  2. Use python=3.7 environment.

Things happen during installation process:

  1. conda uninstall shapely doesn't find package so I directly install it.

Here's the new error output, thanks again for the help!

Screen Shot 2022-07-12 at 9 23 10 AM
yufang1039 commented 2 years ago

Hi @sronilsson One more info. I changed back to python 3.6 to see if the problem is with Xcode, but it still crash. Python 3.7 won't crash so it looks like the problem is with python version. But it does generate new error message.

sronilsson commented 2 years ago

hi @yufang1039! Thanks, the error msg in the image, suggest that you have to downgrade jinja to a version lower than 3.0 https://stackoverflow.com/questions/72651555/attributeerror-module-jinja2-ext-has-no-attribute-autoescape-while-trying-t

I presume it did not boot up after that error msg? I am running this xcode version and SimBA runs fine if it helps: image

yufang1039 commented 2 years ago

hi @sronilsson I downgrade the jinja2 package version to 2.11.3, the jinja2 error disappears but then python 3.7 crash with the same error output. The Xcode version of mine is also 13.4.1.

Screen Shot 2022-07-12 at 11 07 45 AM

I also tried to conda uninstall and then install matplotlib due to the error message but it still doesn't work. The final error out is still the same:

Screen Shot 2022-07-12 at 11 01 10 AM

Is it possible that is because the Mac OS version is too new? I'm using 12.4

sronilsson commented 2 years ago

I don't think it is the OS, this is my OS below and it runs. Xcode sounded plausible, but then we run the same version too. I am runnin git now from Python 3.6.13, conda version 4.9.2, launched from anaconda navigator 1.9.12. I've also pasted a list of all packages installed in my environment to see if you can see anything out of place in ereference to your environment. Google does not come up with a lot on this error.

attrs 21.4.0 pypi_0 pypi brotli 1.0.9 pypi_0 pypi ca-certificates 2022.4.26 hecd8cb5_0
cefpython3 66.0 pypi_0 pypi certifi 2021.5.30 py36hecd8cb5_0
click 8.0.4 pypi_0 pypi cloudpickle 2.1.0 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.12 pypi_0 pypi future 0.18.2 pypi_0 pypi 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 itsdangerous 2.0.1 pypi_0 pypi jinja2 3.0.3 pypi_0 pypi joblib 1.1.0 pypi_0 pypi kiwisolver 1.3.1 pypi_0 pypi libcxx 12.0.0 h2f01273_0
libffi 3.3 hb1e8313_2
llvmlite 0.31.0 pypi_0 pypi markupsafe 2.0.1 pypi_0 pypi matplotlib 3.0.3 pypi_0 pypi ncurses 6.3 hca72f7f_2
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 openssl 1.1.1o hca72f7f_0
pandas 0.25.3 pypi_0 pypi patsy 0.5.2 pypi_0 pypi pillow 5.4.1 pypi_0 pypi pip 21.2.2 py36hecd8cb5_0
plotly 4.9.0 pypi_0 pypi pyarrow 0.17.1 pypi_0 pypi pyparsing 3.0.9 pypi_0 pypi python 3.6.13 h88f2d9e_0
python-dateutil 2.8.2 pypi_0 pypi python-graphviz 0.11 pypi_0 pypi pytz 2022.1 pypi_0 pypi pywavelets 1.1.1 pypi_0 pypi pyyaml 5.3.1 pypi_0 pypi readline 8.1.2 hca72f7f_1
retrying 1.3.3 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 py36hecd8cb5_0
shap 0.35.0 pypi_0 pypi shapely 1.7.0 pypi_0 pypi simba-uw-tf-dev 0.92.2 pypi_0 pypi six 1.16.0 pypi_0 pypi sqlite 3.38.3 h707629a_0
statsmodels 0.9.0 pypi_0 pypi tables 3.6.1 pypi_0 pypi tabulate 0.8.3 pypi_0 pypi tk 8.6.12 h5d9f67b_0
toolz 0.11.2 pypi_0 pypi tqdm 4.30.0 pypi_0 pypi typing-extensions 4.1.1 pypi_0 pypi werkzeug 2.0.3 pypi_0 pypi wheel 0.37.1 pyhd3eb1b0_0
wxpython 4.0.4 pypi_0 pypi xgboost 0.90 pypi_0 pypi xlrd 1.2.0 pypi_0 pypi xz 5.2.5 hca72f7f_1
yellowbrick 0.9.1 pypi_0 pypi zipp 3.6.0 pypi_0 pypi zlib 1.2.12 h4dc903c_2

image

yufang1039 commented 2 years ago

Hi @sronilsson, I would very appreciate if you can send me a copy of your environment.yml file so I can directly copy your conda environment and see if it works.

sronilsson commented 2 years ago

👍 i have to zip it here

environment.yml.zip

yufang1039 commented 2 years ago

Hi @sronilsson

I unzip the yml file and import it through anaconda. There's a pip error about

Screen Shot 2022-07-12 at 2 49 36 PM

I fix it by remove the "python-" and the importation is successful. Then, when I type simba, I got the error message in:

https://stackoverflow.com/questions/21784641/installation-issue-with-matplotlib-python

But I'm able to solve it by follow the instruction in that post.

Then I try to type simba again, but got new error message:

Screen Shot 2022-07-12 at 3 05 45 PM

I fix it by conda install shapely. And it finally works! Thanks so much for your help! Let me know if you want me to write a full step instruction to close this issue.

Screen Shot 2022-07-12 at 3 22 02 PM
sronilsson commented 2 years ago

Wow! Yes! You don't have to be super detailed, but I think it could be helpful. If you do, I will include it in the FAQ (or a link to it if longer) and replace my incorrect assumptions in there...

yufang1039 commented 2 years ago
  1. use anaconda to import this environment. environment.yml.zip

  2. There is a directory in your root called ~/.matplotlib. Create a file ~/.matplotlib/matplotlibrc there and add the following code: backend: TkAgg https://stackoverflow.com/questions/21784641/installation-issue-with-matplotlib-python

  3. Do "conda install shapely" in this new anaconda environment

  4. Type simba to check if it works!

sronilsson commented 2 years ago

I see, thanks!