gallantlab / pycortex

Pycortex is a python-based toolkit for surface visualization of fMRI data
https://gallantlab.github.io/pycortex
BSD 2-Clause "Simplified" License
598 stars 139 forks source link

ImportError: Cannot Import Name 'formats' After Installing pycortex on Linux #535

Open seungju9810 opened 6 months ago

seungju9810 commented 6 months ago

Hello, I am a graduate student studying neuroscience. Thank you for developing the excellent tool, Pycortex.

I installed Pycortex on a Linux server, and when I tried importing cortex, I encountered the following error. ImportError: cannot import name 'formats' from partially initialized module 'cortex' (most likely due to a circular import) (~/pycortex/cortex/init.py) Pycortex error

I haven't modified anything after installing Pycortex, so I am unsure what could be causing this issue. I would greatly appreciate any guidance on how to resolve this error. Thank you in advance for your help!

mvdoc commented 6 months ago

Hi @seungju9810,

Make sure to run your ipython session from a different directory than the directory with the pycortex git repository. Otherwise python will try to import the modules from the git repository (in ~/SpeechDecoding/pycortex), rather than from the correct directory containing all installed packages for your python environment.

If that doesn't solve the problem, make sure to install Pycortex from pypi with python -m pip install pycortex.