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

Cannot install on Apple Silicon M1 #263

Closed bdy2530 closed 1 year ago

bdy2530 commented 1 year ago

Describe the bug Can't install python 3.6.0 or simba into anaconda environment

To Reproduce Steps to reproduce the behavior:

  1. Create new anaconda environment for simba
  2. Attempt to conda install python=3.6.0

Expected behavior Python should install to allow me to install simba.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Additional context Error log `(base) baran@dhcp-10-102-45-150 ~ % conda activate simba (simba) baran@dhcp-10-102-45-150 ~ % pip install simba-uw-tf-dev zsh: command not found: pip (simba) baran@dhcp-10-102-45-150 ~ % conda install python=3.6.0 Collecting package metadata (current_repodata.json): done Solving environment: failed with initial frozen solve. Retrying with flexible solve. Collecting package metadata (repodata.json): done Solving environment: failed with initial frozen solve. Retrying with flexible solve.

PackagesNotFoundError: The following packages are not available from current channels:

Current channels:

To search for alternate channels that may provide the conda package you're looking for, navigate to

https://anaconda.org

and use the search bar at the top of the page.`

Solutions I have tried (with errors nested)

conda install python=3.6 –––– while this allowed me to install python 3.6.13, this gave another error (WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.",)': /simple/simba-uw-tf-dev/ Could not fetch URL https://pypi.org/simple/simba-uw-tf-dev/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/simba-uw-tf-dev/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.",)) - skipping ERROR: Could not find a version that satisfies the requirement simba-uw-tf-dev (from versions: none) ERROR: No matching distribution found for simba-uw-tf-dev)
conda install python=3.6.2 –––– I found this can bypass the SSL error from above and allow me to run pip install simba-uw-tf-dev along with the rest of the MacOS installation tutorial. But, attempting to run simba gives a massive error code Traceback (most recent call last): File "/Users/baran/anaconda3/envs/simba/bin/simba", line 5, in from simba.SimBA import main File "/Users/baran/anaconda3/envs/simba/lib/python3.6/site-packages/simba/SimBA.py", line 8, in from PIL import ImageTk File "/Users/baran/anaconda3/envs/simba/lib/python3.6/site-packages/PIL/ImageTk.py", line 31, in from . import Image File "/Users/baran/anaconda3/envs/simba/lib/python3.6/site-packages/PIL/Image.py", line 114, in from . import _imaging as core ImportError: dlopen(/Users/baran/anaconda3/envs/simba/lib/python3.6/site-packages/PIL/_imaging.cpython-36m-darwin.so, 0x0002): Library not loaded: @rpath/libtiff.5.dylib Referenced from: /Users/baran/anaconda3/envs/simba/lib/python3.6/site-packages/PIL/_imaging.cpython-36m-darwin.so Reason: tried: '/Users/baran/anaconda3/envs/simba/lib/libtiff.5.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/System/Volumes/Preboot/Cryptexes/OS/Users/baran/anaconda3/envs/simba/lib/libtiff.5.dylib' (no such file), '/Users/baran/anaconda3/envs/simba/lib/libtiff.5.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/System/Volumes/Preboot/Cryptexes/OS/Users/baran/anaconda3/envs/simba/lib/libtiff.5.dylib' (no such file), '/Users/baran/anaconda3/envs/simba/lib/python3.6/site-packages/PIL/../../../libtiff.5.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/Users/baran/anaconda3/envs/simba/lib/libtiff.5.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/System/Volumes/Preboot/Cryptexes/OS/Users/baran/anaconda3/envs/simba/lib/libtiff.5.dylib' (no such file), '/Users/baran/anaconda3/envs/simba/lib/libtiff.5.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/System/Volumes/Preboot/Cryptexes/OS/Users/baran/anaconda3/envs/simba/lib/libtiff.5.dylib' (no such file), '/Users/baran/anaconda3/envs/simba/lib/python3.6/site-packages/PIL/../../../libtiff.5.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/Users/baran/anaconda3/envs/simba/lib/libtiff.5.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/System/Volumes/Preboot/Cryptexes/OS/Users/baran/anaconda3/envs/simba/lib/libtiff.5.dylib' (no such file), '/Users/baran/anaconda3/envs/simba/lib/libtiff.5.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/System/Volumes/Preboot/Cryptexes/OS/Users/baran/anaconda3/envs/simba/lib/libtiff.5.dylib' (no such file), '/Users/baran/anaconda3/envs/simba/bin/../lib/libtiff.5.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/Users/baran/anaconda3/envs/simba/lib/libtiff.5.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/System/Volumes/Preboot/Cryptexes/OS/Users/baran/anaconda3/envs/simba/lib/libtiff.5.dylib' (no such file), '/Users/baran/anaconda3/envs/simba/lib/libtiff.5.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/System/Volumes/Preboot/Cryptexes/OS/Users/baran/anaconda3/envs/simba/lib/libtiff.5.dylib' (no such file), '/Users/baran/anaconda3/envs/simba/bin/../lib/libtiff.5.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/usr/local/lib/libtiff.5.dylib' (no such file), '/usr/lib/libtiff.5.dylib' (no such file, not in dyld cache)
Will add as I attempt more fixes
sronilsson commented 1 year ago

Hello @bdy2530 ! Sorry for delay, I missed this one.

It seems something may have gone astray when the conda environment was created: pip and python should come with it.

Try: (i) conda create -n simba_env python=3.6 (ii) conda activate simba_env (iii) pip install simba-uw-tf-dev (iv) On my mac, I sometimes have to reinstall matplotlib through conda: pip uninstall matplotlib followed by conda install matplotlib (iv) and to launch, type simba

Let me know how it goes!

sronilsson commented 1 year ago

Another way would be to try the docker image, but the drawback there is that I have not setup any ci cd to auto update to the docker image with each pip/github update, so docker updates drags behind for now.

Siriz23 commented 9 months ago

Hi! Sorry to reopen this issue but I am dealing with the same situation: This is my error message after I tried "conda create -n simba_env python=3.6"

<Collecting package metadata (current_repodata.json): done Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source. Collecting package metadata (repodata.json): done Solving environment: failed

PackagesNotFoundError: The following packages are not available from current channels:

Current channels:

To search for alternate channels that may provide the conda package you're looking for, navigate to

https://anaconda.org

and use the search bar at the top of the page.>

sronilsson commented 9 months ago

Hi @Siriz23 no problem - how does it go when you try in a python3.9 environment?

Siriz23 commented 9 months ago

Unfortunately it is worse because I had so many issues with different dependencies such as numpy, cython, matplotlib. All of them with different timing. I am going to try again, starting from the scratch: Error1 -->

Screenshot 2023-12-13 at 16 08 22

I've uninstalled and installed Shapely.

Error2-->

Screenshot 2023-12-13 at 16 09 00

And here I am completely stuck

sronilsson commented 9 months ago

Got it someone yesterday-ish raised this on their M1 on Gitter, never really was solved: https://matrix.to/#/!afKEsAvrtNfxHHEeIJ:gitter.im/$77Tddm33m4MkWcWHGa4zoU2LIQFC0_RO603oivCjMj4?via=gitter.im&via=matrix.org&via=matrix.freyachat.eu

It seems to be using a cache, if you install simba with the --no-cache-dir flag how does it look? Sorry I can't troubleshoot this as I don't have access to the M1..

Siriz23 commented 9 months ago

Thank you for your feedback! I'll give it another shot tomorrow. By the way, I'm curious if it's possible to install it on a MacBook with an M1 chip🥲

ligeralde commented 7 months ago

Thank you for your feedback! I'll give it another shot tomorrow. By the way, I'm curious if it's possible to install it on a MacBook with an M1 chip🥲

Were you able to figure this problem out?

sronilsson commented 7 months ago

Hi @ligeralde! What error are you seeing, is it the python 3.6 error?

ligeralde commented 7 months ago

Hi @ligeralde! What error are you seeing, is it the python 3.6 error?

When i run simba, i get AttributeError: 'version_info' object has no attribute '__version__'

ligeralde commented 7 months ago

Hi @ligeralde! What error are you seeing, is it the python 3.6 error?

When i run simba, i get AttributeError: 'version_info' object has no attribute '__version__'

this may be a problem with my environment

sronilsson commented 7 months ago

Interesting, do you have a full traceback to see which lines are causing it?

Also which version of Simba do you see with pip show simba-uw-tf-dev ?

ligeralde commented 7 months ago

Interesting, do you have a full traceback to see which lines are causing it?

Also which version of Simba do you see with pip show simba-uw-tf-dev ? v1.86.6 image

sronilsson commented 7 months ago

There is a suggested fix here: https://stackoverflow.com/a/70061207

Try pip install pyparsing==2.4.7 and then try to launch Simba, how does it look?

ligeralde commented 7 months ago

There is a suggested fix here: https://stackoverflow.com/a/70061207

Try pip install pyparsing==2.4.7 and then try to launch Simba, how does it look?

Thanks, this is a step in the right direction! I still get this warning, not sure if it's a big deal image

sronilsson commented 7 months ago

I'm not sure, have not seen it before? If it's just a warning I wouldn't worry for now. If you get any errors related to plotting and matplotlib let me know here and we can dig into it as we'd hopefully receive a more informative error msg