MouseLand / suite2p

cell detection in calcium imaging recordings
http://www.suite2p.org
GNU General Public License v3.0
344 stars 240 forks source link

BUG: Module not found: sbxreader #1012

Closed rcpeene closed 9 months ago

rcpeene commented 1 year ago

Describe the issue:

After pip installing Suite2p in a Jupyter notebook on a windows machine, I got an error when running import suite2p. The dependency sbxreader is not found. Pip installing sbxreader fixed the bug. Perhaps it belongs in Suite2p's requirements?

Reproduce the code example:

import suite2p

Error message:

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
File c:\Users\carter.peene\AppData\Local\Programs\Python\Python39\lib\site-packages\suite2p\io\sbx.py:11
     10 try:
---> 11     from sbxreader import sbx_memmap
     12 except:

ModuleNotFoundError: No module named 'sbxreader'

During handling of the above exception, another exception occurred:

ModuleNotFoundError                       Traceback (most recent call last)
Cell In[2], line 1
----> 1 import suite2p

File c:\Users\carter.peene\AppData\Local\Programs\Python\Python39\lib\site-packages\suite2p\__init__.py:6
      4 from .version import version
      5 from .default_ops import default_ops
----> 6 from .run_s2p import run_s2p, run_plane, pipeline
      7 from .detection import ROI, detection_wrapper
      8 from .classification import classify

File c:\Users\carter.peene\AppData\Local\Programs\Python\Python39\lib\site-packages\suite2p\run_s2p.py:15
     12 import numpy as np
     13 #from scipy.io import savemat
---> 15 from . import extraction, io, registration, detection, classification, default_ops
     17 try:
     18     from haussmeister import haussio

File c:\Users\carter.peene\AppData\Local\Programs\Python\Python39\lib\site-packages\suite2p\extraction\__init__.py:5
      1 """
      2 Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
      3 """
      4 from .dcnv import preprocess, oasis
----> 5 from .extract import create_masks_and_extract, enhanced_mean_image, extract_traces_from_masks, extraction_wrapper
      6 from .masks import create_cell_mask, create_neuropil_masks, create_cell_pix

File c:\Users\carter.peene\AppData\Local\Programs\Python\Python39\lib\site-packages\suite2p\extraction\extract.py:11
      9 from numba.typed import List
     10 from scipy import stats, signal
---> 11 from .masks import create_masks
     12 from ..io import BinaryFile
     13 from .. import default_ops

File c:\Users\carter.peene\AppData\Local\Programs\Python\Python39\lib\site-packages\suite2p\extraction\masks.py:9
      6 import numpy as np
      7 from scipy.ndimage import percentile_filter
----> 9 from ..detection.sparsedetect import extendROI
     10 from .. import default_ops
     13 def create_masks(stats: List[Dict[str, Any]], Ly, Lx, ops=default_ops()):

File c:\Users\carter.peene\AppData\Local\Programs\Python\Python39\lib\site-packages\suite2p\detection\__init__.py:4
      1 """
      2 Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
      3 """
----> 4 from .detect import detect, detection_wrapper, bin_movie
      5 from .stats import roi_stats, ROI

File c:\Users\carter.peene\AppData\Local\Programs\Python\Python39\lib\site-packages\suite2p\detection\detect.py:11
      9 from . import sourcery, sparsedetect, chan2detect, utils
     10 from .stats import roi_stats
---> 11 from .denoise import pca_denoise
     12 from ..io.binary import BinaryFile
     13 from ..classification import classify, user_classfile

File c:\Users\carter.peene\AppData\Local\Programs\Python\Python39\lib\site-packages\suite2p\detection\denoise.py:8
      6 import time
      7 from sklearn.decomposition import PCA
----> 8 from ..registration.nonrigid import make_blocks, spatial_taper
     11 def pca_denoise(mov: np.ndarray, block_size: List, n_comps_frac: float):
     12     t0 = time.time()

File c:\Users\carter.peene\AppData\Local\Programs\Python\Python39\lib\site-packages\suite2p\registration\__init__.py:4
      1 """
      2 Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
      3 """
----> 4 from .register import (registration_wrapper, save_registration_outputs_to_ops,
      5                        compute_enhanced_mean_image)
      6 from .metrics import get_pc_metrics
      7 from .zalign import compute_zpos

File c:\Users\carter.peene\AppData\Local\Programs\Python\Python39\lib\site-packages\suite2p\registration\register.py:12
      9 import numpy as np
     10 from scipy.signal import medfilt, medfilt2d
---> 12 from .. import io, default_ops
     13 from . import bidiphase as bidi
     14 from . import utils, rigid, nonrigid

File c:\Users\carter.peene\AppData\Local\Programs\Python\Python39\lib\site-packages\suite2p\io\__init__.py:7
      5 from .nwb import save_nwb, read_nwb, nwb_to_binary
      6 from .save import combined, compute_dydx, save_mat
----> 7 from .sbx import sbx_to_binary
      8 from .tiff import mesoscan_to_binary, ome_to_binary, tiff_to_binary, generate_tiff_filename, save_tiff
      9 from .nd2 import nd2_to_binary

File c:\Users\carter.peene\AppData\Local\Programs\Python\Python39\lib\site-packages\suite2p\io\sbx.py:16
     14     from subprocess import call
     15     call("pip install sbxreader", shell=True)
---> 16     from sbxreader import sbx_memmap
     19 def sbx_to_binary(ops, ndeadcols=-1, ndeadrows=0):
     20     """  finds scanbox files and writes them to binaries
     21 
     22     Parameters
   (...)
     32 
     33     """

ModuleNotFoundError: No module named 'sbxreader'

Version information:

suite2p v0.14.0

Context for the issue:

No response

chriski777 commented 9 months ago

Hi @rcpeene, this issue should be addressed in the latest version of suite2p following 6c64686. I'll close this for now but feel free to reopen this issue if the problem persists after updating suite2p.