setuptools-scm was unable to detect version for'…/…/某git包'
鱼香ROS介绍:
鱼香ROS是由机器人爱好者共同组成的社区,欢迎一起参与机器人技术交流。 进群加V:fishros2048
文章信息:
标题:setuptools-scm was unable to detect version for'…/…/某git包' 原文地址:https://fishros.org.cn/forum/topic/81 关键词: 参与者: 904048425,小鱼, 版权声明: 文章中所有知识产权归鱼香ROS及原作者所有。
1. 904048425看着代码说:你好小鱼,我在安装好的pytorch环境下按照readme运行了在github上下载的一个程序包,还没运行起来就卡在了第一步,运行setup.py install 时出现如下错误
LookupError: setuptools-scm was unable to detect version for '/home/wxy/mypython/grasp_det_seg_cnn'.
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.
困住了我两天了,在网上查找原因少之又少,应该是setuptools-scm获取python version的问题,奈何自己学识尚浅,不会修改,烦请小鱼帮忙看一下。我得设备版本如下:
ubuntu:18.04
python:3.9
pytorch:1.11.0
cuda:10.1
setuptools:33.1.1
setuptools:1.15.0
其中,git包文件如下: setup.py
from os import path, listdir
import setuptools
from torch.utils.cpp_extension import BuildExtension, CUDAExtension
def find_sources(root_dir):
sources = []
for file in listdir(root_dir):
_, ext = path.splitext(file)
if ext in [".cpp", ".cu"]:
sources.append(path.join(root_dir, file))
return sources
def make_extension(name, package):
return CUDAExtension(
name="{}.{}._backend".format(package, name),
sources=find_sources(path.join("src", name)),
extra_compile_args={
"cxx": ["-O3"],
"nvcc": ["--expt-extended-lambda"],
},
include_dirs=["include/"],
)
here = path.abspath(path.dirname(__file__))
with open(path.join(here, "README.md"), encoding="utf-8") as f:
long_description = f.read()
setuptools.setup(
# Meta-data
name="GraspDetSeg_CNN",
author="Stefan Ainetter",
author_email="stefan.ainetter@icg.tugraz.at",
description="Grasp Detection and Segmentation for Pytorch, code based on Seamless Scene Segmentation (https://github.com/mapillary/seamseg).",
long_description_content_type="text/markdown",
url="",
classifiers=[
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
],
# Versioning
use_scm_version={"root": ".", "relative_to": __file__, "write_to": "grasp_det_seg/_version.py"},
# Requirements
setup_requires=["setuptools_scm"],
python_requires=">=3,
关注
打赏
最近更新
- 深拷贝和浅拷贝的区别(重点)
- 【Vue】走进Vue框架世界
- 【云服务器】项目部署—搭建网站—vue电商后台管理系统
- 【React介绍】 一文带你深入React
- 【React】React组件实例的三大属性之state,props,refs(你学废了吗)
- 【脚手架VueCLI】从零开始,创建一个VUE项目
- 【React】深入理解React组件生命周期----图文详解(含代码)
- 【React】DOM的Diffing算法是什么?以及DOM中key的作用----经典面试题
- 【React】1_使用React脚手架创建项目步骤--------详解(含项目结构说明)
- 【React】2_如何使用react脚手架写一个简单的页面?