![](/img/trans.png)
[英]How to know if a git repository is clean with Python3 (pygit2)?
[英]python3 + pygit: “No module named 'repository'”
當將python3與pygit
依賴項一起使用時,我遇到了一條錯誤消息:
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文件鎖定您的依賴項,以防止這種情況發生。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.