MouseLand / suite2p

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

Unable to import suite2p in the correct conda environment despite successful installation #978

Closed fifth-island closed 1 year ago

fifth-island commented 1 year ago

Describe the issue:

Hello,

I have been attempting to utilize Suite2P within a designated Anaconda environment (Python 3.8) on my MacOS with an Apple Silicon chip. However, I am encountering an issue while trying to import the Suite2P module in my Jupyter Notebook on PyCharm.

To provide a brief overview of my steps so far:

  1. I installed Anaconda via Rosetta, following which I created a new Conda environment named 'suite2p'.
  2. Within this environment, I attempted to install Suite2P using pip. The installation seemingly progressed without any evident issues.
  3. I subsequently activated the 'suite2p' environment and initiated Jupyter Notebook within the same.
  4. Despite these measures, upon attempting to import Suite2P in my Jupyter Notebook using "from suite2p import run_s2p, default_ops", I was met with a ModuleNotFoundError stating: No module named 'suite2p'.
  5. Further to this, I verified the path to the Python interpreter in the Jupyter Notebook, confirming it does indeed point to the Python environment within 'suite2p'.

Despite several efforts to reinstall Suite2P within this environment, the issue remains unresolved. Given the circumstances, I believe this may be a result of an incorrect Python folder setup for Suite2P, though I'm uncertain how to investigate this further. Here is the code that keeps getting me an error:

import numpy as np import sys sys.path.insert(0, 'C:/Users/joaoquintanilha/anaconda3/envs/suite2p/lib/suite2p/') from suite2p import run_s2p, default_ops

I would appreciate any advice or guidance on how to navigate this issue. Have I overlooked a step in the installation process, or could there be a pre-existing issue with Suite2P compatibility on MacOS with the Apple Silicon chip?

Thank you in advance for your assistance.

Provide environment info:

(suite2p) joaoquintanilha@Joaos-MacBook-Pro pythonProject % conda info

 active environment : suite2p
active env location : /Users/joaoquintanilha/anaconda3/envs/suite2p
        shell level : 2
   user config file : /Users/joaoquintanilha/.condarc

populated config files : conda version : 23.3.1 conda-build version : 3.24.0 python version : 3.10.9.final.0 virtual packages : __archspec=1=x86_64 osx=10.16=0 unix=0=0 base environment : /Users/joaoquintanilha/anaconda3 (writable) conda av data dir : /Users/joaoquintanilha/anaconda3/etc/conda conda av metadata url : None channel URLs : https://repo.anaconda.com/pkgs/main/osx-64 https://repo.anaconda.com/pkgs/main/noarch https://repo.anaconda.com/pkgs/r/osx-64 https://repo.anaconda.com/pkgs/r/noarch package cache : /Users/joaoquintanilha/anaconda3/pkgs /Users/joaoquintanilha/.conda/pkgs envs directories : /Users/joaoquintanilha/anaconda3/envs /Users/joaoquintanilha/.conda/envs platform : osx-64 user-agent : conda/23.3.1 requests/2.28.1 CPython/3.10.9 Darwin/21.6.0 OSX/10.16 UID:GID : 501:20 netrc file : None offline mode : False

chriski777 commented 1 year ago

Hi @fifth-island, in your suite2p environment, what do you see when you type in the command pip show suite2p? If you see some output with the version number (should be around 0.12~), then suite2p should be correctly installed. The steps you're taking (1-5) also seem right too.

Just wondering, in your notebook, why are you adding the line sys.path.insert(0,'C:/Users/joaoquintanilha/anaconda3/envs/suite2p/lib/suite2p/') ?

chriski777 commented 1 year ago

Hi @fifth-island, just wanted to follow up on this and see if this issue still persists for you.

chriski777 commented 1 year ago

Closing this issue due to inactivity.