-1
我已經創建了包含Profile
但類名enviroment.py
文件,當我在另一個文件試圖導入像import testProject.enviroment import Profile
文件我得到以下錯誤進口不工作
yaml_helper.py", line 11, in read_yaml
with open(file_path, 'r') as f:
IOError: [Errno 2] No such file or directory:
但是我的特殊類米不知道爲什麼它會給出這個錯誤,因爲配置文件甚至沒有初始化。我所做的一切都是導入它?
enviroment.py
class Profile(object):
def __init__(self, profile):
self.profile = yaml_helper.read_yaml(project.default_profiles_dir, profile)
self.run_enviroment()
def get(self, key):
return self.profile.get(key)
def run_enviroment(self):
return common.validate(connectors.exasol_credentials, self.profile)
我只調用'yaml_helper.read_yaml'在配置文件和即時通訊甚至沒有初始化'配置文件'只導入 –
而你得到那個錯誤?那很有意思。所以你不會在任何地方調用'Profile()'?然後,我不知道。 – SH7890
@PeterPik接受答案意味着這是問題嗎? – SH7890