kushalkolar / MESmerize

Platform for Calcium Imaging analysis. DEPRECATED.
GNU General Public License v3.0
58 stars 14 forks source link

[INSTALLATION HELP] #80

Closed kevinpan0127 closed 2 years ago

kevinpan0127 commented 2 years ago

Operating System & specs (CPU, RAM etc.) MacOS Monterey, Apple M1 pro, 32GB RAM

Details about your Mesmerize install Followed installation on the mesmerize document page for MacOS except for caiman installation. Used "mamba create -n caiman -c conda-forge caiman" after "source activate mesmerize" as the original code gets stuck at solving environment

Describe the issue, please be as explicit and detailed as possible. I have finished all installation steps, however when opening mesmerize, this is the error i am getting:

(mesmerize) kevin@Kevins-MacBook-Pro ~ % mesmerize Traceback (most recent call last): File "/opt/anaconda3/envs/mesmerize/bin/mesmerize", line 5, in from mesmerize.main import main File "/opt/anaconda3/envs/mesmerize/lib/python3.6/site-packages/mesmerize/init.py", line 1, in from .analysis import * File "/opt/anaconda3/envs/mesmerize/lib/python3.6/site-packages/mesmerize/analysis/init.py", line 1, in from .data_types import Transmission File "/opt/anaconda3/envs/mesmerize/lib/python3.6/site-packages/mesmerize/analysis/data_types.py", line 14, in import pandas as pd File "/opt/anaconda3/envs/mesmerize/lib/python3.6/site-packages/pandas/init.py", line 55, in from pandas.core.api import ( File "/opt/anaconda3/envs/mesmerize/lib/python3.6/site-packages/pandas/core/api.py", line 5, in from pandas.core.arrays.integer import ( File "/opt/anaconda3/envs/mesmerize/lib/python3.6/site-packages/pandas/core/arrays/init.py", line 13, in from .sparse import SparseArray # noqa: F401 File "/opt/anaconda3/envs/mesmerize/lib/python3.6/site-packages/pandas/core/arrays/sparse/init.py", line 3, in from pandas.core.arrays.sparse.accessor import SparseAccessor, SparseFrameAccessor File "/opt/anaconda3/envs/mesmerize/lib/python3.6/site-packages/pandas/core/arrays/sparse/accessor.py", line 10, in from pandas.core.arrays.sparse.array import SparseArray File "/opt/anaconda3/envs/mesmerize/lib/python3.6/site-packages/pandas/core/arrays/sparse/array.py", line 44, in from pandas.core.arrays.sparse.dtype import SparseDtype File "/opt/anaconda3/envs/mesmerize/lib/python3.6/site-packages/pandas/core/arrays/sparse/dtype.py", line 9, in from pandas._typing import Dtype, DtypeObj ImportError: cannot import name 'DtypeObj'

How should I be able to solve this? Thank you!

kushalkolar commented 2 years ago

Can you please try this https://stackoverflow.com/questions/68926935/importerror-cannot-import-name-dtypearg-from-pandas

On Tue, Jan 25, 2022, 09:03 kevinpan0127 @.***> wrote:

Assigned #80 https://github.com/kushalkolar/MESmerize/issues/80 to @kushalkolar https://github.com/kushalkolar.

— Reply to this email directly, view it on GitHub https://github.com/kushalkolar/MESmerize/issues/80#event-5950088753, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACHXXRESAVKQKQ33L2K6TR3UX2UTPANCNFSM5MYK6UJQ . You are receiving this because you were assigned.Message ID: @.***>

kevinpan0127 commented 2 years ago

I have downgraded pandas to 1.1.0 as 1.3.0 cannot be found

(mesmerize) kevin@Kevins-MacBook-Pro ~ % pip install pandas==1.3.0 ERROR: Could not find a version that satisfies the requirement pandas==1.3.0 (from versions: 0.1, 0.2, 0.3.0, 0.4.0, 0.4.1, 0.4.2, 0.4.3, 0.5.0, 0.6.0, 0.6.1, 0.7.0, 0.7.1, 0.7.2, 0.7.3, 0.8.0, 0.8.1, 0.9.0, 0.9.1, 0.10.0, 0.10.1, 0.11.0, 0.12.0, 0.13.0, 0.13.1, 0.14.0, 0.14.1, 0.15.0, 0.15.1, 0.15.2, 0.16.0, 0.16.1, 0.16.2, 0.17.0, 0.17.1, 0.18.0, 0.18.1, 0.19.0, 0.19.1, 0.19.2, 0.20.0, 0.20.1, 0.20.2, 0.20.3, 0.21.0, 0.21.1, 0.22.0, 0.23.0, 0.23.1, 0.23.2, 0.23.3, 0.23.4, 0.24.0, 0.24.1, 0.24.2, 0.25.0, 0.25.1, 0.25.2, 0.25.3, 1.0.0, 1.0.1, 1.0.2, 1.0.3, 1.0.4, 1.0.5, 1.1.0, 1.1.1, 1.1.2, 1.1.3, 1.1.4, 1.1.5) ERROR: No matching distribution found for pandas==1.3.0

Following that, I have received an error regarding scikit-learn

(mesmerize) kevin@Kevins-MacBook-Pro ~ % pip install pandas==1.1.0 Collecting pandas==1.1.0 Downloading pandas-1.1.0-cp36-cp36m-macosx_10_9_x86_64.whl (10.6 MB) |████████████████████████████████| 10.6 MB 6.5 MB/s Requirement already satisfied: pytz>=2017.2 in /opt/anaconda3/envs/mesmerize/lib/python3.6/site-packages (from pandas==1.1.0) (2021.3) Requirement already satisfied: numpy>=1.15.4 in /opt/anaconda3/envs/mesmerize/lib/python3.6/site-packages (from pandas==1.1.0) (1.19.5) Requirement already satisfied: python-dateutil>=2.7.3 in /opt/anaconda3/envs/mesmerize/lib/python3.6/site-packages (from pandas==1.1.0) (2.8.2) Requirement already satisfied: six>=1.5 in /opt/anaconda3/envs/mesmerize/lib/python3.6/site-packages (from python-dateutil>=2.7.3->pandas==1.1.0) (1.16.0) Installing collected packages: pandas Attempting uninstall: pandas Found existing installation: pandas 1.1.5 Uninstalling pandas-1.1.5: Successfully uninstalled pandas-1.1.5 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. mesmerize 0.7.1 requires scikit-learn~=0.23.1, but you have scikit-learn 0.24.2 which is incompatible.

Thus I downgraded scikit-learn to 0.23.1 using "pip install scikit-learn~=0.23.1"

I am able to open mesmerize after that but I am getting the error message below:

(mesmerize) kevin@Kevins-MacBook-Pro ~ % mesmerize /opt/anaconda3/envs/mesmerize/lib/python3.6/site-packages/mesmerize/common/configuration.py:38: UserWarning: Caiman package not found. Caiman features will be disabled. "Caiman package not found. " /opt/anaconda3/envs/mesmerize/lib/python3.6/site-packages/mesmerize/common/configuration.py:49: UserWarning: tensorflow not found. Nuset segmentation will be disabled "tensorflow not found. Nuset segmentation will be disabled" /opt/anaconda3/envs/mesmerize/lib/python3.6/site-packages/sklearn/utils/deprecation.py:143: FutureWarning: The sklearn.cluster.kmeans module is deprecated in version 0.22 and will be removed in version 0.24. The corresponding classes / functions should instead be imported from sklearn.cluster. Anything that cannot be imported from sklearn.cluster is now part of the private API. warnings.warn(message, FutureWarning) Loading, please wait... QApplication::exec: Please instantiate the QApplication object first zsh: segmentation fault mesmerize (mesmerize) kevin@Kevins-MacBook-Pro ~ % ipython Python 3.6.13 |Anaconda, Inc.| (default, Feb 23 2021, 12:58:59) Type 'copyright', 'credits' or 'license' for more information IPython 7.16.3 -- An enhanced Interactive Python. Type '?' for help.

I tried importing caiman using ipython with import caiman but it shows that the module cannot be found.

In [1]: import caiman

ModuleNotFoundError Traceback (most recent call last)

in ----> 1 import caiman ModuleNotFoundError: No module named 'caiman' How should i proceed? Thank you!
kushalkolar commented 2 years ago

@kevinpan0127

There are some weird issues with python3.6 and newer packages right now. We're working on updating the installation, these instructions are not finalized yet but it's worth giving it a shot:

  1. Create an environment.yml file with the following contents
name: mesmerize

channels:
  - conda-forge

# From the conda ecosystem.
dependencies:
  - python=3.8
  - pip
  - tensorflow==2.4
  - caiman==1.9.4
  # From the PyPI ecosystem.
  - pip:
    - tslearn==0.4.1
    - mesmerize
  1. Run:
mamba create -n mesmerize && mamba env update -n mesmerize --f environment.yml
kevinpan0127 commented 2 years ago

I was able to get it installed using "mamba install -c conda-forge caiman" and reinstalling mesmerize...

kushalkolar commented 2 years ago

Thanks for sharing how you fixed it!