gpt4 book ai didi

python3 + pygit : "No module named ' repository'"

转载 作者:行者123 更新时间:2023-12-01 00:41:56 41 4
gpt4 key购买 nike

当使用带有 pygit 依赖项的 python3 时,我遇到了一个错误:

Traceback (most recent call last):
File "generate.py", line 8, in <module>
from git import Repo, NoSuchPathError, InvalidGitRepositoryError
File "/mnt/c/Users/foo/venv/lib/python3.6/site-packages/git/__init__.py", line 6, in <module>
from repository import Repository, InvalidRepositoryError
ModuleNotFoundError: No module named 'repository'

如果我在站点包中find,我会找到一个名为repository的模块。这是怎么回事?

最佳答案

您打算使用名为 gitpython 的不同模块。您需要卸载 pygit 并获取 gitpython

专业提示:使用requirements.txt 文件锁定您的依赖项以防止发生这种情况。

关于python3 + pygit : "No module named ' repository'",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57279457/

41 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com