谜我......
导入包灾难..为什么?
contents of yenlib:
/var/yenlib
- __init__.py
- yenlib
- __init__.py
- json_.py
import sys
sys.path.append('/var/yenlib')
sys.path.append('/var/yenlib/yenlib')
from yenlib import json_ as json
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: cannot import name json_
答案 0 :(得分:0)
跳过第二个&#34;追加&#34;声明并从yenlib.yenlib导入
import sys
sys.path.append("/var/yenlib")
from yenlib.yenlib import json_ as json