kushalkolar / MESmerize

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

CaImAn Install Issue - Windows/Linux Dual Boot[INSTALLATION HELP] #71

Closed WhereWolf72 closed 2 years ago

WhereWolf72 commented 2 years ago

System information

  1. OS (Windows 10/Ubuntu 20.04 LTS Dual Boot [run on Ubuntu partition])
  2. CPU (Intel(R) Core(TM) i7-9750H)
  3. RAM (32Gb)
  4. Do you have an SSD or magnetic HDD (SSD)

Copy & paste the entire output of the terminal while you were trying to install when the issue came up:

/home/user/.local/lib/python3.8/site-packages/mesmerize/common/configuration.py:37: UserWarning: Caiman package not found. Caiman features will be disabled.
  warn(
2021-10-21 11:14:33.297075: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcudart.so.11.0'; dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory
2021-10-21 11:14:33.297096: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
/home/user/.local/lib/python3.8/site-packages/sklearn/utils/deprecation.py:143: FutureWarning: The sklearn.cluster.k_means_ 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... 
%(asctime)s %(levelname)s %(pathname)s %(lineno)s 
 %(message)s 
Moving old logfiles...
Moving old logfiles...
QApplication::exec: Please instantiate the QApplication object first
Segmentation fault (core dumped)

Installation method

  1. Are you using anaconda, python virtual environments, or something else? conda 4.10.3, but installed with mamba

  2. If you're installing mesmerize through pip, what version of pip is installed in the environment? pip 21.3

  3. Are you trying to install in developer mode from the repo? No

  4. What is the python version in the environment you're trying to install mesmerize in? python=3.8

  5. Information if you're using some other installation method. Installed caiman using mamba in a conda environment. I can see caiman in the environment, but there seems to be issues, even after using caimanmanager.py. I believe it may stem from dependency issues from tensorflow.

kushalkolar commented 2 years ago

This looks like a Qt mismatch, possibly due to opencv. Can you try:

pip uninstall opencv-python
pip install opencv-python-headless
WhereWolf72 commented 2 years ago

After running your suggestions and then attempting to open mesmerize, I got the following:

_/home/user/.local/lib/python3.8/site-packages/mesmerize/common/configuration.py:37: UserWarning: Caiman package not found. Caiman features will be disabled. warn( 2021-10-21 23:33:10.970995: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcudart.so.11.0'; dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory 2021-10-21 23:33:10.971069: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine. ===== 2021.10.21 23:10:13 ===== Traceback (most recent call last): File "/home/user/.local/bin/mesmerize", line 5, in from mesmerize.main import main File "/home/user/.local/lib/python3.8/site-packages/mesmerize/init.py", line 1, in from .analysis import File "/home/user/.local/lib/python3.8/site-packages/mesmerize/analysis/init.py", line 3, in from .math import cross_correlation, drfft_dtw, tvregdiff File "/home/user/.local/lib/python3.8/site-packages/mesmerize/analysis/math/drfft_dtw.py", line 7, in from ...plotting.variants.timeseries import TimeseriesPlot File "/home/user/.local/lib/python3.8/site-packages/mesmerize/plotting/init.py", line 1, in from .variants import File "/home/user/.local/lib/python3.8/site-packages/mesmerize/plotting/variants/init.py", line 1, in from .heatmap import Heatmap File "/home/user/.local/lib/python3.8/site-packages/mesmerize/plotting/variants/heatmap.py", line 13, in from ...pyqtgraphCore.widgets.MatplotlibWidget import MatplotlibWidget File "/home/user/.local/lib/python3.8/site-packages/mesmerize/pyqtgraphCore/init.py", line 266, in from .imageview import File "/home/user/.local/lib/python3.8/site-packages/mesmerize/pyqtgraphCore/imageview/init.py", line 6, in from .ImageView import ImageView File "/home/user/.local/lib/python3.8/site-packages/mesmerize/pyqtgraphCore/imageview/ImageView.py", line 40, in from ...viewer.core.viewer_work_environment import ViewerWorkEnv File "/home/user/.local/lib/python3.8/site-packages/mesmerize/viewer/init.py", line 1, in from .main_window import MainWindow as ViewerWindow File "/home/user/.local/lib/python3.8/site-packages/mesmerize/viewer/main_window.py", line 19, in from .modules import File "/home/user/.local/lib/python3.8/site-packages/mesmerize/viewer/modules/femtonics_mesc.py", line 16, in from cv2 import bitwisenot ModuleNotFoundError: No module named 'cv2'

I then tried to install cv2, but got the following error:

ERROR: Could not find a version that satisfies the requirement cv2 (from versions: none) ERROR: No matching distribution found for cv2

kushalkolar commented 2 years ago

did you pip install opencv-python-headless

WhereWolf72 commented 2 years ago

Yes, but I ran it again just to make sure. It returns the following:

Requirement already satisfied: opencv-python-headless in ./anaconda3/envs/caiman/lib/python3.8/site-packages (4.5.4.58) Requirement already satisfied: numpy>=1.17.3 in ./anaconda3/envs/caiman/lib/python3.8/site-packages (from opencv-python-headless) (1.21.3)

Thank you so much for being so quick to respond, by the way!

WhereWolf72 commented 2 years ago

It may be worth noting that the only way I could get caiman to install into the conda environment via conda-forge was to install it first (before mesmerize or any of the packages noted in the mesmerize installation guide), right after I created the environment. Would this change anything?

kushalkolar commented 2 years ago

You might need to install opencv-python-headless through conda then, not exactly sure which conda channel would be required for this since I'm not too familiar with conda.

Since you're on Ubuntu, I'd recommend installing it using the built-in python venv. It's faster and creates far less issues than anaconda.

WhereWolf72 commented 2 years ago

That solved it! Must be something with the conda environments. Caiman now loads (or at least I don't get an error when launching Mesmerize). Thank you!