解决python中NameError: name os is not defined

解决python中NameError: name ‘os’ is not defined

运行时报错,网上给出的解决方案大多都是import os,但代码中已有import os依旧报错,最后找到一种可行的方法:把import os放到其他import之后,即

from model import *
from utils import *
from config import *
import os

运行成功。

解决方案链接

猜你喜欢

转载自blog.csdn.net/Peggiehu/article/details/107003301
今日推荐