如果存在.git文件夹,则pip install editable在windows中失败

2024-03-28 21:17:12 发布

您现在位置:Python中文网/ 问答频道 /正文

如果我创建一个基本包:

eg/
  setup.py
  eg/
     __init__.py
     mod.py

带着设置.py谁的内容是

^{pr2}$

一个什么都不做的模块模型py公司名称:

class EG():
    pass

如果我移动到eg/文件夹并执行(Windows中的Anaconda 3提示符),它安装得很好

pip install -e . 

但如果包中有.git文件夹,即:

eg/
  .git
  setup.py
  eg/
     __init__.py
     mod.py

我得到以下错误

 error: [WinError 2] Das System kann die angegebene Datei nicht finden
 File Finder Failed for .git = setuptools_scm.git:list_files_in_archive

因为我正在开发包并频繁提交,所以不能删除.git文件夹。你知道当有一个.git文件夹时如何让pip安装工作吗?在

PS:我在Ubuntu中没有遇到过这样的问题。这种情况只发生在Windows中。在


Tags: 模块pippy模型git文件夹名称mod
1条回答
网友
1楼 · 发布于 2024-03-28 21:17:12

你使用的setuptools_scm不是一个标准的包,这就是为什么你在Ubuntu中没有问题。在

如果您没有在setup.py中使用setuptools_scm,请尝试将其卸载:

pip uninstall setuptools_scm

相关问题 更多 >