mne-tools / mne-nirs

Process Near-Infrared Spectroscopy Data in MNE
https://mne.tools/mne-nirs/
BSD 3-Clause "New" or "Revised" License
79 stars 35 forks source link

import throws ModuleNotFoundError for 'seaborn' #517

Closed girishmm closed 1 year ago

girishmm commented 1 year ago

Description of the problem

On install via pip, the expected behaviour is that all dependencies are installed and post-this, it is possible to import the module with import mne_nirs. But import throws a ModuleNotFoundError for 'seaborn'.

I have tried it twice to confirm it. First, using poetry (which uses pip internally). And then, directly using pip in a separate new environment. In both the case, the error was thrown.

On installing seaborn manually, the error goes away and normal functionality is restored.

Steps to reproduce

Use pip to install mne-nirs. Open python shell and attempt to import.

import mne_nirs

Link to data

No response

Expected results

>>> import mne_nirs

Returns with no error.

Actual results

>>> import mne_nirs
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/homebrew/Caskroom/miniconda/base/lib/python3.10/site-packages/mne_nirs/__init__.py", line 10, in <module>
    from . import statistics
  File "/opt/homebrew/Caskroom/miniconda/base/lib/python3.10/site-packages/mne_nirs/statistics/__init__.py", line 7, in <module>
    from ._glm_level_first import (RegressionResults, ContrastResults,
  File "/opt/homebrew/Caskroom/miniconda/base/lib/python3.10/site-packages/mne_nirs/statistics/_glm_level_first.py", line 28, in <module>
    from ..visualisation._plot_GLM_topo import _plot_glm_topo,\
  File "/opt/homebrew/Caskroom/miniconda/base/lib/python3.10/site-packages/mne_nirs/visualisation/__init__.py", line 7, in <module>
    from ._plot_quality_metrics import plot_timechannel_quality_metric
  File "/opt/homebrew/Caskroom/miniconda/base/lib/python3.10/site-packages/mne_nirs/visualisation/_plot_quality_metrics.py", line 5, in <module>
    import seaborn as sns
ModuleNotFoundError: No module named 'seaborn'

Additional information

Platform macOS-13.4-arm64-arm-64bit Python 3.10.12 (main, Jul 5 2023, 15:02:25) [Clang 14.0.6 ] Executable /opt/homebrew/Caskroom/miniconda/base/bin/python CPU arm (8 cores) Memory Unavailable (requires "psutil" package) Core ├☑ mne 1.4.2 ├☑ numpy 1.25.2 (OpenBLAS 0.3.23.dev with 8 threads) ├☑ scipy 1.11.1 ├☑ matplotlib 3.7.2 (backend=MacOSX) ├☑ pooch 1.7.0 └☑ jinja2 3.1.2

Numerical (optional) ├☑ sklearn 1.3.0 ├☑ nibabel 5.1.0 ├☑ nilearn 0.10.1 ├☑ pandas 2.0.3 └☐ unavailable numba, dipy, openmeeg, cupy

Visualization (optional) └☐ unavailable pyvista, pyvistaqt, ipyvtklink, vtk, qtpy, ipympl, pyqtgraph, mne-qt-browser

Ecosystem (optional) └☐ unavailable mne-bids, mne-nirs, mne-features, mne-connectivity, mne-icalabel, mne-bids-pipeline

welcome[bot] commented 1 year ago

Hello! 👋 Thanks for opening your first issue here! ❤️ We will try to get back to you soon. 🚴

larsoner commented 1 year ago

This appears to be an issue with mne-nirs rather than MNE-Python so I'll transfer the issue over there!

larsoner commented 1 year ago

@girishmm I think we need to add seaborn to the INSTALL_REQUIRES here:

https://github.com/mne-tools/mne-nirs/blob/main/setup.py#L28

Would you be up for making a PR to do this?

girishmm commented 1 year ago

Ah, yes it is. My bad for opening it in mne-python. The GitHub link in mne-nirs docs brought me to mne-python. Maybe this link can be changed to the mne-nirs repo?

And sure, I will raise a PR to add seaborn to the dependencies list this right away.

larsoner commented 1 year ago

That would be here if you want to update it, too:

https://github.com/mne-tools/mne-nirs/blob/main/doc/conf.py#L140