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
620 stars 364 forks source link

Tensorflow - h5py dependency error @ mamba install #951

Closed mathildelpx closed 2 years ago

mathildelpx commented 2 years ago
  1. Operating system:

Windows 10 Pro

  1. Python version:

Python 3.9

  1. Working environment:

install problem

  1. CaImAn version: 1.9.7 from git @master

  2. CaImAn installation process:

git clone https://github.com/flatironinstitute/CaImAn
cd CaImAn
mamba env create -f environment.yml -n caiman
(base) C:\...\CaImAn>mamba env create -f environment.yml -n caiman

conda-forge/win-64       Using cache
conda-forge/noarch       Using cache
pkgs/r/noarch            [====================] (00m:00s) No change
pkgs/main/noarch         [====================] (00m:00s) No change
pkgs/r/win-64            [====================] (00m:00s) No change
pkgs/msys2/win-64        [====================] (00m:00s) No change
pkgs/msys2/noarch        [====================] (00m:00s) No change
pkgs/main/win-64         [====================] (00m:00s) No change

Looking for: ["python[version='>=3.9']", 'bokeh', 'coverage', 'cython', 'future', "h5py[version='>=2.10.0,<3']", 'holoviews', 'ipykernel', 'ipython', 'ipyparallel', 'jupyter', 'matplotlib', 'mypy', 'nose', 'numpy', 'numpydoc', 'opencv', 'peakutils', 'pims', 'psutil', 'pynwb', 'pyqtgraph', "scikit-image[version='>=0.19.0']", 'scikit-learn', 'scipy', 'tensorflow', 'tifffile', 'tk', 'tqdm', 'yapf']

Encountered problems while solving.
Problem: package tensorflow-2.6.0-mkl_py39h31650da_0 requires tensorflow-base 2.6.0 mkl_py39h9201259_0, but none of the providers can be installed

I tried adding tensorflow-base to the environment.yml file, and got the Following error:

Encountered problems while solving. 
Problem: package tensorflow-base-2.6.0-mkl_py39h9201259_0 requires h5py >=3.1.0, but none of the providers can be installed                                                                                                                            

Which is I think caused by - h5py >=2.10.0,<3 in the yml file. Could you please provide the version of tensorflow and tensorflow-base that are compatible with h5py <3?

Thanks a lot !

pgunn commented 2 years ago

I will look into this issue; please take that tensorflow-base back out of your environment.yml file.

Try pinning tensorflow 2.4; that may solve the issue (for now ; longer term we'll need to move to h5py 3.x, although that will take some effort)

pgunn commented 2 years ago

Another thing to try (fairly different); remove your git checkout of the caiman sources, and just do this:

mamba create -n caiman -c conda-forge caiman

Let me know how that goes.

GarrettBlair commented 2 years ago

I was having the same problem and this seemed to solve the environment creation. For instance I did:

git clone https://github.com/flatironinstitute/CaImAn
cd CaImAn
mamba create -n caiman -c conda-forge caiman
mamba install -n caiman vs2017_win-64

Does this method still allow us to modify code present under user\CaImAn\caiman\...? Thanks for your help

pgunn commented 2 years ago

@GarrettBlair There are two entirely distinct install paths:

1) Build the needed environment using mamba/conda (without installing caiman itself), do a git clone of the sources, and then doing a pip install of those sources (which compiles stuff). This can be a pain to make work because it means potentially fiddling with a compiler, but it lets you modify the caiman sources freely before/after install.

2) Build the needed environment using mamba/conda including the binary caiman package we provide. If you do this, you don't need a compiler and there are fewer steps, but you shouldn't expect to modify the caiman sources if you're doing this.

What you typed above is a hybrid and is not what I recommend.

If you want to discuss it further, please hop onto Gitter: https://gitter.im/agiovann/Constrained_NMF And we can work through your needs and the right set of steps to meet them.

--Pat