Local installation from sources - failing due to version not being parsable
See original GitHub issueI did the following things:
- Download latest release tar from github here
- Extracted tar file
- Ran
python3 setup.py install --prefix=<>
- 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:
- Created 3 years ago
- Comments:11 (5 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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
orpython -m pep517.build --source .
(once we added apyproject.toml
) to generate the tarball.I guess we can close this;
setuptools_scm
doesn’t work with archives built usinggit archive
.