python - LookupError: setuptools-scm 无法检测版本(使用 python setup.py install 时)
问题描述
我正在尝试在python虚拟环境3.7(名为“py37”)中安装setup.py(来自网站:https ://github.com/richpsharp/ipbes-analysis/tree/1.1.0/ipbes-ndr) .
我输入:
- git 克隆https://github.com/richpsharp/ipbes-analysis.git
- cd ipbes-分析\ipbes-ndr
- python setup.py 安装
但是,我得到了错误:
C:\Users\86134>activate py37
(py37) C:\Users\86134>cd ipbes-analysis\ipbes-ndr
(py37) C:\Users\86134\ipbes-analysis\ipbes-ndr>python setup.py install
Traceback (most recent call last):
File "setup.py", line 26, in <module>
language="c++",
File "F:\Anaconda3\envs\py37\lib\site-packages\setuptools\__init__.py", line 153, in setup
return distutils.core.setup(**attrs)
File "F:\Anaconda3\envs\py37\lib\distutils\core.py", line 108, in setup
_setup_distribution = dist = klass(attrs)
File "F:\Anaconda3\envs\py37\lib\site-packages\setuptools\dist.py", line 433, in __init__
k: v for k, v in attrs.items()
File "F:\Anaconda3\envs\py37\lib\distutils\dist.py", line 292, in __init__
self.finalize_options()
File "F:\Anaconda3\envs\py37\lib\site-packages\setuptools\dist.py", line 708, in finalize_options
ep(self)
File "F:\Anaconda3\envs\py37\lib\site-packages\setuptools\dist.py", line 715, in _finalize_setup_keywords
ep.load()(self, ep.name, value)
File "F:\Anaconda3\envs\py37\lib\site-packages\setuptools_scm\integration.py", line 26, in version_keyword
dist.metadata.version = _get_version(config)
File "F:\Anaconda3\envs\py37\lib\site-packages\setuptools_scm\__init__.py", line 173, in _get_version
parsed_version = _do_parse(config)
File "F:\Anaconda3\envs\py37\lib\site-packages\setuptools_scm\__init__.py", line 142, in _do_parse
"use git+https://github.com/user/proj.git#egg=proj" % config.absolute_root
LookupError: setuptools-scm was unable to detect version for 'C:\\Users\\86134\\ipbes-analysis\\ipbes-ndr'.
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
setup.py的内容是:
"""setup.py module for ipbes_ndr_analysis module."""
from Cython.Build import cythonize
import numpy
from setuptools.extension import Extension
from setuptools import setup
setup(
name='ipbes ndr analysis',
packages=[
'ipbes_ndr_analysis',
],
package_dir={
'ipbes_ndr_analysis': 'src/ipbes_ndr_analysis'
},
use_scm_version={
'version_scheme': 'post-release',
'local_scheme': 'node-and-date'},
setup_requires=['setuptools_scm', 'cython', 'numpy'],
include_package_data=True,
ext_modules=cythonize(
[Extension(
"ipbes_ndr_analysis_cython",
sources=["src/ipbes_ndr_analysis/ipbes_ndr_analysis_cython.pyx"],
include_dirs=[numpy.get_include()],
language="c++",
)],
)
)
我不确定如何解决此错误...任何帮助将不胜感激。谢谢!!
玉琪
解决方案
推荐阅读
- javascript - 如何在使用 navigator.mediaDevices.getUserMedia 录制音频时修复大量回声?
- android - zzrb.zza 导致每个其他 cameraX analyzer.analyze 帧除以零算术异常
- c - 如何判断 UDP 数据包何时来自本地机器?
- qt - qtserialport 与 qtcreator-ros-plugin 中的 CMake?
- powershell - 如何查找日期范围内的文件
- memory-management - IIS 工作进程对同一服务器上的相同站点的内存使用率很高
- javascript - 防止在 HTML 中提交表单时重定向
- github-actions - 使用来自 github 操作的文件内容创建新问题
- c# - 尝试使用 C# 将数据插入 MS Access 数据库,但插入命令不起作用
- r - 如何清理不规则字符串并将它们组织到右列的数据框中