Skip to content

fix: pip install failed with message, LookupError: setuptools-scm was unable to detect version#267

Closed
adRn-s wants to merge 7 commits into
mainfrom
install_fix
Closed

fix: pip install failed with message, LookupError: setuptools-scm was unable to detect version#267
adRn-s wants to merge 7 commits into
mainfrom
install_fix

Conversation

@adRn-s

@adRn-s adRn-s commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

fix: coerce lane type to string in sampleSheet construction for lanesplitted illumina flow cells to accomodate '1+2' case.

setuptools will be writing __version__ inside src/dissectBCL/_version.py from now on. this way pip install . works alright (note that release 1.0.0 is not installable as it is)

@WardDeb

WardDeb commented Jun 13, 2026

Copy link
Copy Markdown
Member

do you have git in your PATH ?
I'm not following what this actually fixes

@adRn-s

adRn-s commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator Author

do you have git in your PATH ? I'm not following what this actually fixes

I just reproduced this locally, on my laptop (with git in PATH.)

This is to fix the release 1.0.0 which should actually be disabled once we release a patch.

I will paste the log for this error that was fixed with 2 lines in pyproject toml (so that setuptools find version number.)

❯ wget https://github.com/maxplanck-ie/dissectBCL/archive/refs/tags/v1.0.0.tar.gz
HTTP response 302  [https://github.com/maxplanck-ie/dissectBCL/archive/refs/tags/v1.0.0.tar.gz]
Enqueue https://codeload.github.com/maxplanck-ie/dissectBCL/tar.gz/refs/tags/v1.0.0
Saving 'v1.0.0.tar.gz'
HTTP response 200  [https://codeload.github.com/maxplanck-ie/dissectBCL/tar.gz/refs/tags/v1.0.0]
v1.0.0.tar.gz        100% [==================================================================================================================================>]   64.22K    --.-KB/s
                          [Files: 1  Bytes: 64.22K [150.05KB/s] Redirects: 1  Todo: 0  Errors: 0                                                              ]

❯ tar xvf v1.0.0.tar.gz
dissectBCL-1.0.0/
[...] output truncated manually [...]
dissectBCL-1.0.0/tests/todo.md

❯ cd dissectBCL-1.0.0/

❯ conda env create -f env.yml --name dissectBCL
Retrieving notices: done
Channels:
 - conda-forge
 - bioconda
 - mpi-ie
Platform: linux-64
Collecting package metadata (repodata.json): done
Solving environment: done

Downloading and Extracting Packages:
                                                                                                                                                                                     
Preparing transaction: done                                                                                                                                                          
Verifying transaction: done                                                                                                                                                          
Executing transaction: done                                                                                                                                                          
#                                                                                                                                                                                    
# To activate this environment, use                                                                                                                                                  
#                                                                                                                                                                                    
#     $ conda activate dissectBCL                                                                                                                                                    
#                                                                                                                                                                                    
# To deactivate an active environment, use                                                                                                                                           
#                                                                                                                                                                                    
#     $ conda deactivate                                                                                                                                                             
                                                                                                                                                                                     
❯ conda activate dissectBCL

❯ pip install .
Processing ./.
  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
  ╰─> [67 lines of output]
      Traceback (most recent call last):
        File "/home/anzo/data/conda/envs/dissectBCL/lib/python3.13/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 389, in <module>
          main()
          ~~~~^^
        File "/home/anzo/data/conda/envs/dissectBCL/lib/python3.13/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 373, in main
          json_out["return_val"] = hook(**hook_input["kwargs"])
                                   ~~~~^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/anzo/data/conda/envs/dissectBCL/lib/python3.13/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 143, in get_requires_for_build_wheel
          return hook(config_settings)
        File "/tmp/pip-build-env-ca8d3s2a/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 333, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=[])
                 ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-ca8d3s2a/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 301, in _get_build_requires
          self.run_setup()
          ~~~~~~~~~~~~~~^^
        File "/tmp/pip-build-env-ca8d3s2a/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 317, in run_setup
          exec(code, locals())
          ~~~~^^^^^^^^^^^^^^^^
        File "<string>", line 1, in <module>
        File "/tmp/pip-build-env-ca8d3s2a/overlay/lib/python3.13/site-packages/setuptools/__init__.py", line 117, in setup
          return distutils.core.setup(**attrs)  # type: ignore[return-value]
                 ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
        File "/tmp/pip-build-env-ca8d3s2a/overlay/lib/python3.13/site-packages/setuptools/_distutils/core.py", line 148, in setup
          _setup_distribution = dist = klass(attrs)
                                       ~~~~~^^^^^^^
        File "/tmp/pip-build-env-ca8d3s2a/overlay/lib/python3.13/site-packages/setuptools/dist.py", line 321, in __init__
          _Distribution.__init__(self, dist_attrs)
          ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-ca8d3s2a/overlay/lib/python3.13/site-packages/setuptools/_distutils/dist.py", line 307, in __init__
          self.finalize_options()
          ~~~~~~~~~~~~~~~~~~~~~^^
        File "/tmp/pip-build-env-ca8d3s2a/overlay/lib/python3.13/site-packages/setuptools/dist.py", line 790, in finalize_options
          ep(self)
          ~~^^^^^^
        File "/home/anzo/data/conda/envs/dissectBCL/lib/python3.13/contextlib.py", line 85, in inner
          return func(*args, **kwds)
        File "/tmp/pip-build-env-ca8d3s2a/overlay/lib/python3.13/site-packages/setuptools_scm/_integration/setuptools.py", line 192, in infer_version
          _infer_version_impl(
          ~~~~~~~~~~~~~~~~~~~^
              dist,
              ^^^^^
          ...<3 lines>...
              _get_version_inference_config=_get_version_inference_config,
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
          )
          ^
        File "/tmp/pip-build-env-ca8d3s2a/overlay/lib/python3.13/site-packages/setuptools_scm/_integration/setuptools.py", line 225, in _infer_version_impl
          result.apply(dist)
          ~~~~~~~~~~~~^^^^^^
        File "/tmp/pip-build-env-ca8d3s2a/overlay/lib/python3.13/site-packages/setuptools_scm/_integration/version_inference.py", line 123, in apply
          data = infer_version_with_config(
              self.dist_name,
              self.pyproject_data,  # type: ignore[arg-type]
              self.overrides,
          )
        File "/tmp/pip-build-env-ca8d3s2a/overlay/lib/python3.13/site-packages/setuptools_scm/_integration/version_inference.py", line 67, in infer_version_with_config
          _version_missing(config)
          ~~~~~~~~~~~~~~~~^^^^^^^^
        File "/tmp/pip-build-env-ca8d3s2a/overlay/lib/python3.13/site-packages/vcs_versioning/_get_version_impl.py", line 207, in _version_missing
          raise LookupError(error_msg)
      LookupError: setuptools-scm was unable to detect version for /var/mnt/data/bioinfo/dissectBCL-1.0.0.
      
      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
      
      Alternatively, set the version with the environment variable SETUPTOOLS_SCM_PRETEND_VERSION_FOR_${NORMALIZED_DIST_NAME} as described in https://setuptools-scm.readthedocs.io/en/latest/config/
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed to build 'file:///var/mnt/data/bioinfo/dissectBCL-1.0.0' when getting requirements to build wheel

PS. I am fixing the CI jobs now. And @NavandarM has a fix for an error that we encountered today in production.

Co-authored-by: NavandarM <navandar@ie-freiburg.mpg.de>
Co-authored-by: Pipeline Project User <pipegrp@longus2.ie-freiburg.mpg.de>
@WardDeb

WardDeb commented Jun 16, 2026

Copy link
Copy Markdown
Member

Thx for clarifying. I guess this is specific to getting source code tarball:

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.

@WardDeb WardDeb changed the title fix!: pip install failed with message, LookupError: setuptools-scm was unable to detect version fix: pip install failed with message, LookupError: setuptools-scm was unable to detect version Jun 16, 2026
@adRn-s

adRn-s commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator Author

Thx for clarifying. I guess this is specific to getting source code tarball:

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.

Oh no, I only went with the source tarball after it failed, with the same error, installing from /home/pipegrp/repos/dissectBCL (clean repo, checkout to 1.0.0 or even main ATM)

@adRn-s adRn-s requested review from NavandarM and WardDeb June 16, 2026 14:04
@adRn-s

adRn-s commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator Author

Btw, the same installation issues are happening with BRB. Same error message, so I added a new branch install_fix at that repo too.

@WardDeb

WardDeb commented Jun 16, 2026

Copy link
Copy Markdown
Member

I cannot reproduce this, not via pip, not via uv, not via pixi..
Anyhow I also don't think this can harm, as long as editable install version commit hashes are propagated in the version itself.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is all of this overhead really needed ?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems good to me

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file can go to gitignore then I guess ? No use in keeping these dev tags

@adRn-s adRn-s closed this Jun 17, 2026
@adRn-s

adRn-s commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator Author

My issue was fixed by conda install git before pip install . so I'm closing this. I am having difficulties to understand what was wrong... seems like a me-thing, combined with something else (bug upstream, on setuptools-scm maybe??)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants