question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Local installation from sources - failing due to version not being parsable

See original GitHub issue

I did the following things:

  1. Download latest release tar from github here
  2. Extracted tar file
  3. Ran
python3 setup.py install --prefix=<>
  1. Got this error:
Traceback (most recent call last):
  File "setup.py", line 4, in <module>
    setup(use_scm_version=True)
  File "/opt/gnu/9.3.0/python/3.8.3/lib/python3.8/site-packages/setuptools/__init__.py", line 145, in setup
    return distutils.core.setup(**attrs)
  File "/opt/gnu/9.3.0/python/3.8.3/lib/python3.8/distutils/core.py", line 108, in setup
    _setup_distribution = dist = klass(attrs)
  File "/opt/gnu/9.3.0/python/3.8.3/lib/python3.8/site-packages/setuptools/dist.py", line 445, in __init__
    _Distribution.__init__(self, {
  File "/opt/gnu/9.3.0/python/3.8.3/lib/python3.8/distutils/dist.py", line 292, in __init__
    self.finalize_options()
  File "/opt/gnu/9.3.0/python/3.8.3/lib/python3.8/site-packages/setuptools/dist.py", line 734, in finalize_options
    ep.load()(self, ep.name, value)
  File "/opt/gnu/9.3.0/python/3.8.3/lib/python3.8/site-packages/setuptools_scm/integration.py", line 17, in version_keyword
    dist.metadata.version = _get_version(config)
  File "/opt/gnu/9.3.0/python/3.8.3/lib/python3.8/site-packages/setuptools_scm/__init__.py", line 148, in _get_version
    parsed_version = _do_parse(config)
  File "/opt/gnu/9.3.0/python/3.8.3/lib/python3.8/site-packages/setuptools_scm/__init__.py", line 110, in _do_parse
    raise LookupError(
LookupError: setuptools-scm was unable to detect version for '/home/nicpa/installation/bash-build/.compile/py-3.8/xarray-0.16.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

I think this is because the tar’s created by tagging does not contain the version information anywhere. The setuptools_scm reads versions according to this

As far as I can see, one should create a PKG-INFO with this content:

Version: <version>

I then tried this and then it worked. It would be ideal if the release pages have a fully functional installation procedure. This is mainly useful for non-pip installations etc.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
keewiscommented, Jul 27, 2020

is there a reason why you can’t use the sdist archive from PyPI? I think that archive contains the desired PKG-INFO file.

Edit: I’m not quite sure if we can make github run python setup.py sdist or python -m pep517.build --source . (once we added a pyproject.toml) to generate the tarball.

0reactions
keewiscommented, Sep 6, 2020

I guess we can close this; setuptools_scm doesn’t work with archives built using git archive.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Failed to build Kubernetes: failed to parse source version ...
You need to setup a working Kubernetes development environment. This error means kind was unable to detect the version from your local sources ......
Read more >
What is INSTALL_PARSE_FAILED_NO_CERTIFICATES error?
I found that this error can now also occur when using the wrong signing config. As described here, Android 7.0 introduces a new...
Read more >
Installation/Upgrading Issues - Snipe-IT Documentation
When you see this error, it means that you either forgot to install or run composer, or you did and it failed somewhere...
Read more >
Troubleshoot Tableau Server Install and Upgrade
Limited disk space can cause a failure to install, a failure to upgrade, or problems running Tableau Server. Restart Tableau Server. Issues related...
Read more >
Windows Installer Error Messages (for Developers)
No valid source could be found for product [2]. 1707, Installation operation completed successfully. 1708, Installation operation failed. 1709
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found