CaImAn icon indicating copy to clipboard operation
CaImAn copied to clipboard

caimanmanager.py install fail

Open katesal327 opened this issue 2 years ago • 18 comments

For better support, please use the template below to submit your issue. When your issue gets resolved please remember to close it.

Sometimes errors while running CNMF occur during parallel processing which prevents the log to provide a meaningful error message. Please reproduce your error with setting dview=None.

If you need to upgrade CaImAn follow the instructions given in the documentation.

  • Tell us a bit about your setup:
  1. Operating system (Linux/macOS/Windows): Windows 10

  2. Python version (3.x): 3.9.7

  3. Working environment (Python IDE/Jupyter Notebook/other): conda

  4. Which of the demo scripts you're using for your analysis (if applicable):

  5. CaImAn version*: recent

  6. CaImAn installation process (pip install ./pip install -e ./conda): conda *You can get the CaImAn version by creating a params object and then typing params.data['caiman_version']. If the field doesn't exist, type N/A and consider upgrading)

  • Describe the issue that you are experiencing trying to install caimanmanager.py and not working. Used the instructions provided in the readme and did not work. Used the following as well and still did not unpack...also was looking for caimanmanager.py in the wrong directory...it is here: C:\Users\scott\anaconda3\envs\mesmerize-core\bin

  • Copy error log below

import sysconfig sysconfig.get_path('scripts') 'C:\Users\scott\anaconda3\envs\mesmerize-core\Scripts' python 'C:\Users\scott\anaconda3\envs\mesmerize-core\Scripts\caimanmanager.py' install

  • If you're not reporting an error, type your message below

katesal327 avatar Oct 11 '22 00:10 katesal327

Hello, Can you provide the error message when the instructions first don't work?

pgunn avatar Oct 11 '22 13:10 pgunn

C:\Users\scott\anaconda3\envs\mesmerize-core\python.exe: can't open file 'C:\Users\scott\anaconda3\envs\mesmerize-core\Scripts\caimanmanager.py': [Errno 2] No such file or directory

katesal327 avatar Oct 11 '22 17:10 katesal327

which makes sense because the caimanmanager.py file is not in that directory

katesal327 avatar Oct 11 '22 17:10 katesal327

I found a work around but wanted to let you know

katesal327 avatar Oct 11 '22 17:10 katesal327

is this a bug in the demo_motion_correction notebook? Last block of the notebbook...the file is in the directory and exists

**FileNotFoundError Traceback (most recent call last) Cell In [19], line 7 5 plt.figure(figsize = (20,10)) 6 for cnt, fl, metr in zip(range(len(fls)),fls,['pw_rigid','rigid','raw']): ----> 7 with np.load(fl) as ld: 8 print(ld.keys()) 9 print(fl)

File ~\anaconda3\envs\mesmerize-core\lib\site-packages\numpy\lib\npyio.py:417, in load(file, mmap_mode, allow_pickle, fix_imports, encoding) 415 own_fid = False 416 else: --> 417 fid = stack.enter_context(open(os_fspath(file), "rb")) 418 own_fid = True 420 # Code to distinguish from NumPy binary files and pickles.

FileNotFoundError: [Errno 2] No such file or directory: 'C:\Users\scott\caiman_data\example_movies\Sue_2x_3000_40_-46_els__d1_170_d2_170_d3_1_order_F_frames_3000_._metrics.npz'**

katesal327 avatar Oct 12 '22 17:10 katesal327

Can you cut'n'paste that filename as carefully as you can and do a dir FILENAME ? Perhaps there's some very subtle filename difference between what's there and what the code is looking for.

pgunn avatar Oct 12 '22 17:10 pgunn

ah there are two of them...let me remove one and see if it works

katesal327 avatar Oct 12 '22 18:10 katesal327

dir('C:\Users\scott\caiman_data\example_movies\Sue_2x_3000_40_-46_els__d1_170_d2_170_d3_1_order_F_frames_3000_._metrics.npz')

output: ['add', 'class', 'contains', 'delattr', 'dir', 'doc', 'eq', 'format', 'ge', 'getattribute', 'getitem', 'getnewargs', 'gt', 'hash', 'init', 'init_subclass', 'iter', 'le', 'len', 'lt', 'mod', 'mul', 'ne', 'new', 'reduce', 'reduce_ex', 'repr', 'rmod', 'rmul', 'setattr', 'sizeof', 'str', 'subclasshook', 'capitalize', 'casefold', 'center', 'count', 'encode', 'endswith', 'expandtabs', 'find', 'format', 'format_map', 'index', 'isalnum', 'isalpha', 'isascii', 'isdecimal', 'isdigit', 'isidentifier', 'islower', 'isnumeric', 'isprintable', 'isspace', 'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'maketrans', 'partition', 'removeprefix', 'removesuffix', 'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip', 'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title', 'translate', 'upper', 'zfill'] ​

katesal327 avatar Oct 12 '22 18:10 katesal327

still same error

katesal327 avatar Oct 12 '22 18:10 katesal327

Hello, Sorry, I wasn't clear, please don't use the dir() function; use the dir command from the command prompt.

pgunn avatar Oct 12 '22 18:10 pgunn

(base) C:\Users\scott>​dir C:\Users\scott\caiman_data\example_movies\Sue_2x_3000_40_-46_els__d1_170_d2_170_d3_1_order_F_frames_3000_._metrics.npz '​dir' is not recognized as an internal or external command, operable program or batch file.

katesal327 avatar Oct 12 '22 18:10 katesal327

is that what you mean? sorry I am still new to python

katesal327 avatar Oct 12 '22 18:10 katesal327

That is what I meant, and I am puzzled that you seem to be running on windows but the "dir" command doesn't seem to be working for you. Let's do this instead (do this from your python shell):

import glob
glob.glob('C:/Users/scott/caiman_data/example_movies/Sue*')

pgunn avatar Oct 12 '22 18:10 pgunn

glob.glob('C:/Users/scott/caiman_data/example_movies/Sue*') ['C:/Users/scott/caiman_data/example_movies\Sue_2x_3000_40_-46.tif', 'C:/Users/scott/caiman_data/example_movies\Sue_2x_3000_40_-46_els__d1_170_d2_170_d3_1_order_F_frames_3000_.mmap', 'C:/Users/scott/caiman_data/example_movies\Sue_2x_3000_40_-46_els__d1_170_d2_170_d3_1_order_F_frames_3000__metrics.npz', 'C:/Users/scott/caiman_data/example_movies\Sue_2x_3000_40_-46_metrics.npz', 'C:/Users/scott/caiman_data/example_movies\Sue_2x_3000_40_-46_rig__d1_170_d2_170_d3_1_order_F_frames_3000_.mmap', 'C:/Users/scott/caiman_data/example_movies\Sue_2x_3000_40_-46_rig__d1_170_d2_170_d3_1_order_F_frames_3000__metrics.npz']

katesal327 avatar Oct 12 '22 18:10 katesal327

It looks like something's up with the code to generate filenames that's causing things to not line up correctly; these two don't match:

Sue_2x_3000_40_-46_els__d1_170_d2_170_d3_1_order_F_frames_3000_.mmap Sue_2x_3000_40_-46_els__d1_170_d2_170_d3_1_order_F_frames_3000_._metrics.npz

I'll try to reproduce the issue locally and get back to you as soon as I have an answer. Sorry for the inconvenience.

pgunn avatar Oct 12 '22 19:10 pgunn

okie doke, thanks

katesal327 avatar Oct 12 '22 19:10 katesal327

I have reproduced the issue on my workstation and am working on a fix.

pgunn avatar Oct 12 '22 20:10 pgunn

thanks!

katesal327 avatar Oct 12 '22 20:10 katesal327

Just following up on this: it seems the original caimanmanager.py issue is resolved, and the issue is with file wrangling in the motion correction demo notebook?

EricThomson avatar May 17 '23 20:05 EricThomson

The mcorr file naming stuff was fixed, I had to update mesmerize-core for it as well a few months ago.

pretty sure it was this release: https://github.com/flatironinstitute/CaImAn/releases/tag/v1.9.12

kushalkolar avatar May 17 '23 20:05 kushalkolar

Ok I'll close please let me know if there are objections and I'll re-open. :)

EricThomson avatar May 17 '23 22:05 EricThomson