[英]How can I import module python from my local gitlab?
我使用了 github.com/operatorequals/httpimport,但出現錯誤:“KeyError:'test_wr'”。 文件 test_wr.py 位於我的 gitlab (myserver.locals)
import httpimport
url = "http://myserver.locals/admin_user/python_prod/test_all_py/raw/master/test_dir/test_wr.py"
httpimport.INSECURE = True
with httpimport.remote_repo(["test_wr"], url):
import test_wr
test_wr.init_def('Hi')
此代碼來自 test_wr.py:
def init_def(*args):
return args[0]
/admin_user/ - 組
/python_prod/ - 組(或子組)
/test_all_py/ - 項目
/test_dir/ - 腳本所在的目錄(也位於init .py)
請幫我解決問題!
我解決了它:原始 url 必須是: "http://myserver.locals/admin_user/python_prod/test_all_py/raw/8e904cebf45e7025f68927d8aacd9cb669859002/test_dir"
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.