mirror of
https://github.com/zhayujie/chatgpt-on-wechat.git
synced 2026-04-17 09:22:52 +08:00
feat: add installp/uninstallp command
This commit is contained in:
15
common/package_manager.py
Normal file
15
common/package_manager.py
Normal file
@@ -0,0 +1,15 @@
|
||||
import pip
|
||||
|
||||
def install(package):
|
||||
pip.main(['install', package])
|
||||
|
||||
def install_requirements(file):
|
||||
pip.main(['install', '-r', file, "--upgrade"])
|
||||
|
||||
def check_dulwich():
|
||||
try:
|
||||
import dulwich
|
||||
return
|
||||
except ImportError:
|
||||
install('dulwich')
|
||||
raise ImportError("Unable to import dulwich")
|
||||
Reference in New Issue
Block a user