flatironinstitute / CaImAn

Computational toolbox for large scale Calcium Imaging Analysis, including movie handling, motion correction, source extraction, spike deconvolution and result visualization.
https://caiman.readthedocs.io
GNU General Public License v2.0
640 stars 370 forks source link

Package caiman not found #1115

Closed CatarinaPachec closed 1 year ago

CatarinaPachec commented 1 year ago

Please fill in the following for any issues

Your setup:

  1. Operating System (Linux, MacOS, Windows): Windows
  2. Hardware type (x86, ARM..) and RAM:
  3. Python Version (e.g. 3.9): 3.11
  4. Caiman version (e.g. 1.9.12):
  5. Which demo exhibits the problem (if applicable):
  6. How you installed Caiman (pure conda, conda + compile, colab, ..):
  7. Details: Hello :) We get this error when trying to import all the necessary packages to run motion correction: PackagesNotFoundError: The following packages are not available from current channels:

    • caiman

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.


ModuleNotFoundError Traceback (most recent call last) Cell In[1], line 32 26 logging.basicConfig(format= 27 "%(relativeCreated)12d [%(filename)s:%(funcName)20s():%(lineno)s] [%(process)d] %(message)s", 28 # filename="/tmp/caiman.log", 29 level=logging.DEBUG) 31 get_ipython().system('conda install caiman') ---> 32 import caiman as cm 33 from caiman.motion_correction import MotionCorrect, tile_and_correct, motion_correction_piecewise 34 from caiman.utils.utils import download_demo

ModuleNotFoundError: No module named 'caiman'

We then tried to install caiman in many diferent way such as: mamba install -c conda-forge --override-channels caiman. but we get this error:

Could not solve for environment specs Encountered problems while solving:

The environment can't be solved, aborting the operation

pgunn commented 1 year ago

Hello, Please do the following set of operations: 1) Entirely close jupyter 2) Launch the "command prompt with anaconda" 3) Do a conda env list to see what environnments you have. Please send me that list

We'll work on fixing your install based on what that command shows us.

CatarinaPachec commented 1 year ago

Hello, This is the environments I have.

(base) C:\Users\pachecoc>conda env list

conda environments:

# base * C:\Users\pachecoc\AppData\Local\anaconda3 caiman C:\Users\pachecoc\AppData\Local\anaconda3\envs\caiman

thank you!

pgunn commented 1 year ago

Ah, so right now the caiman environment is not activated. That's something you want to do before launching jupyter.

Please close jupyter entirely, and from that "command prompt with anaconda", do these steps: 1) conda activate caiman 2) jupyter notebook

Then from that jupyter, enter the notebook and see if you can import caiman.

Cheers, Pat

CatarinaPachec commented 1 year ago

Thank you!

I activate the conda environment and launch the jupyter notebook as suggested but the issue is that the caiman env can not install the caiman package properly so when I launch the notebook it can not import caiman. I tried installing caiman on the env through the conda forge channel but I got the error:

Could not solve for environment specs Encountered problems while solving:

nothing provides tensorflow >=2.4.0 needed by caiman-1.9.10-py38hcc40339_0 The environment can't be solved, aborting the operation

pgunn commented 1 year ago

I'm surprised the environment got made with python 3.8. That should not have happened. Let's redo the environment.

1) Close jupyter entirely 2) From the prompt, do conda deactivate 3) conda env remove -n caiman then: 1) mamba create -n caiman -c conda-forge caiman

Let me know if that works - if it does not, show me the message you get.

CatarinaPachec commented 1 year ago

I remove the environment and install it again but I was not able to create the env this time. It seems to be a tensoflow incompatibility issue?

Screenshot 2023-06-20 at 15 13 04 Screenshot 2023-06-20 at 15 12 53
pgunn commented 1 year ago

You're on Windows 10?

pgunn commented 1 year ago

Could you follow this instruction here? https://github.com/tensorflow/tensorflow/issues/24835#issuecomment-453365761

It should enable "long path" support on windows, which might be the issue.

pgunn commented 1 year ago

Actually, these instructions may be easier: https://www.howtogeek.com/266621/how-to-make-windows-10-accept-file-paths-over-260-characters/

CatarinaPachec commented 1 year ago

Hello!

It solved the issue! Thank you!