页次: 1
原来是用错了pip包, 重新来一次:
sudo apt-get install python3-pip -y
python3 -m pip install gitpython
https://github.com/gitpython-developers/GitPython
这次 import 正常了。
安装:
sudo apt-get install python3-pip -y
python3 -m pip install python-git
奇怪了,还是不能import git:
root@test5:/opt# python3
Python 3.6.8 (default, Oct 7 2019, 12:59:55)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import git
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'git'
>>>
>>>
>>>
>>> quit()
页次: 1