MNE Bids pipeline install issue

@sappelhoff @richard @agramfort

I was installing mne_bids_pipeline using the pip installation instructions on the website, but I have been getting errors on linux:
This was a fresh conda env - mamba create -n TEST22 pip
I have also installed it after installing mne through conda forge - still the same issue.

Possible Solution: I am able to install using the following line -
pip install git+https://github.com/mne-tools/mne-bids-pipeline.git#egg=mne-bids-pipeline

Below is the error (adding git+ to the https address with main.zip still fails):

(TEST22) [stoutjd@---- ~]$ pip install https://github.com/mne-tools/mne-bids-pipeline/archive/refs/heads/main.zip
Collecting https://github.com/mne-tools/mne-bids-pipeline/archive/refs/heads/main.zip
  Using cached https://github.com/mne-tools/mne-bids-pipeline/archive/refs/heads/main.zip
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error
  
  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [35 lines of output]
      Traceback (most recent call last):
        File "/home/stoutjd/miniconda3/envs/TEST22/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
          main()
        File "/home/stoutjd/miniconda3/envs/TEST22/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/home/stoutjd/miniconda3/envs/TEST22/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 130, in get_requires_for_build_wheel
          return hook(config_settings)
        File "/tmp/pip-build-env-ufz6kb4w/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 338, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
        File "/tmp/pip-build-env-ufz6kb4w/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 320, in _get_build_requires
          self.run_setup()
        File "/tmp/pip-build-env-ufz6kb4w/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 335, in run_setup
          exec(code, locals())
        File "<string>", line 1, in <module>
        File "/tmp/pip-build-env-ufz6kb4w/overlay/lib/python3.10/site-packages/setuptools/__init__.py", line 87, in setup
          return distutils.core.setup(**attrs)
        File "/tmp/pip-build-env-ufz6kb4w/overlay/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 147, in setup
          _setup_distribution = dist = klass(attrs)
        File "/tmp/pip-build-env-ufz6kb4w/overlay/lib/python3.10/site-packages/setuptools/dist.py", line 476, in __init__
          _Distribution.__init__(
        File "/tmp/pip-build-env-ufz6kb4w/overlay/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 282, in __init__
          self.finalize_options()
        File "/tmp/pip-build-env-ufz6kb4w/overlay/lib/python3.10/site-packages/setuptools/dist.py", line 900, in finalize_options
          ep(self)
        File "/tmp/pip-build-env-ufz6kb4w/overlay/lib/python3.10/site-packages/setuptools_scm/integration.py", line 123, in infer_version
          _assign_version(dist, config)
        File "/tmp/pip-build-env-ufz6kb4w/overlay/lib/python3.10/site-packages/setuptools_scm/integration.py", line 62, in _assign_version
          _version_missing(config)
        File "/tmp/pip-build-env-ufz6kb4w/overlay/lib/python3.10/site-packages/setuptools_scm/__init__.py", line 109, in _version_missing
          raise LookupError(
      LookupError: setuptools-scm was unable to detect version for /tmp/pip-req-build-f05h7vb_.
      
      Make sure you're either building from a fully intact git repository or PyPI tarballs. Most other sources (such as GitHub's tarballs, a git checkout without the .git folder) don't contain the necessary metadata and will not work.
      
      For example, if you're using pip, instead of https://github.com/user/proj/archive/master.zip use git+https://github.com/user/proj.git#egg=proj
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.
  • MNE version: fresh install
  • operating system: Redhat 8 / 7 and Ubuntu 18.04

Hello, you need to check out the git repository for using the development version. We will soon make a release on PyPI which can be directly installed via pip, and we’ll update the documentation accordingly. Thank you for reporting the problem.

Just for reference, which version of setuptools-scm are you using?

Hi Richard,

Thanks for the response. I am able to get the code to install without manually cloning the repo (see bottom of this message), but If I do the typical MNE install, then the below instructions on the mne-bids-pipeline install - it will fail.

Here’s a bare install of MNE and mne-bids-pipeline - which results in the failure from the last post

mamba create -n TEST23 conda-forge::mne -y
conda activate TEST23
pip install https://github.com/mne-tools/mne-bids-pipeline/archive/refs/heads/main.zip

Here’s the setup tools that come with the new conda install of MNE (plus an additional install of setuptools-scm)

(TEST23) [stoutjd@--- ~]$ pip list | grep setup
setuptools                    65.4.1
setuptools-scm                7.0.5

And like I said it seems to work with the following line, just not the one on the website. The mne-bids-pipeline command is installed and will display the help function:

pip install git+https://github.com/mne-tools/mne-bids-pipeline.git#egg=mne-bids-pipeline

(TEST23) [stoutjd@---- ~]$ pip list | grep mne
mne                           1.2.0
mne-bids                      0.11
mne-bids-pipeline             0.1.dev625+g96a618e
mne-qt-browser                0.4.0

I can get this to work for my purposes - just listing it here in case it helps identify a website discrepancy or dependency list for install (at least for linux).

Thanks again,
Jeff Stout

1 Like

Hey @jstout211, thanks for the update! Interesting to see the problem occurs with setuptools-scm >= 7. Aside from that, everything you show is expected behavior. We’ll update the docs and / or add a workaround for GitHub zipballs.

Cheers,
Richard