Traceback (most recent call last): File "D:\Desktop\APIautotest_project\interface_project\main.py", line 11, in <module> from globalpkg.log import logger File "D:\Desktop\APIautotest_project\interface_project\globalpkg\log.py", line 60, in <module> logsignleton = LogSignleton('./config/logconfig.conf') File "D:\Desktop\APIautotest_project\interface_project\globalpkg\log.py", line 34, in __new__ cls.instance.__config_logger() File "D:\Desktop\APIautotest_project\interface_project\globalpkg\log.py", line 53, in __config_logger rt_file_handler = RotatingFileHandler(self.log_filename, maxBytes=self.max_bytes_each, File "D:\Install\Python\Python38\lib\logging\handlers.py", line 148, in __init__ BaseRotatingHandler.__init__(self, filename, mode, encoding, delay) File "D:\Install\Python\Python38\lib\logging\handlers.py", line 55, in __init__ logging.FileHandler.__init__(self, filename, mode, encoding, delay) File "D:\Install\Python\Python38\lib\logging\__init__.py", line 1143, in __init__ StreamHandler.__init__(self, self._open()) File "D:\Install\Python\Python38\lib\logging\__init__.py", line 1172, in _open return open(self.baseFilename, self.mode, encoding=self.encoding) FileNotFoundError: [Errno 2] No such file or directory: 'F:\\project\\interface_project\\logs\\log.txt'
时间: 2023-08-30 14:10:03 浏览: 163
这是一个 Python 错误,指示程序无法找到名为 'F:\\project\\interface_project\\logs\\log.txt' 的文件或目录。从错误信息中可以看到,这个问题是由 RotatingFileHandler 引起的,它试图在指定的路径下创建一个日志文件,但是找不到该路径。
你需要检查一下你的程序是否正确地配置了日志文件的路径和名称,并且确保该路径下存在一个空的、可写的文件夹。如果问题仍然存在,你可以尝试手动创建一个空的日志文件夹和文件。
相关问题
D:\python\python.exe D:\code\Production_Practice_GAN-main\Production_Practice_GAN-main\main.py Traceback (most recent call last): File "D:\code\Production_Practice_GAN-main\Production_Practice_GAN-main\main.py", line 1, in <module> from AnimeGAN import AnimeGAN File "D:\code\Production_Practice_GAN-main\Production_Practice_GAN-main\AnimeGAN.py", line 1, in <module> from ops import * File "D:\code\Production_Practice_GAN-main\Production_Practice_GAN-main\ops.py", line 2, in <module> import tensorflow.contrib as tf_contrib ModuleNotFoundError: No module named 'tensorflow.contrib'
这个错误信息显示你的代码在导入 tensorflow.contrib 模块时出现了问题,可能是因为你的 TensorFlow 版本太新或太旧。在 TensorFlow 2.0 中,已经删除了 tensorflow.contrib 模块,如果你的代码是基于 TensorFlow 1.x 编写的,那么建议你使用 TensorFlow 1.x 的版本来运行代码。如果你已经使用了 TensorFlow 1.x 的版本,那么可以尝试安装适当的 TensorFlow 版本或者检查你的代码中是否存在拼写错误或路径问题。
Traceback (most recent call last): File "D:\pythonProject_ecg_analyzation_x\main.py", line 26, in <module> form = GetModel.getmodel(normalized_beat_xy, ecg_voltage, r_peaks, user_number) File "D:\pythonProject_ecg_analyzation_x\GetModel.py", line 10, in getmodel model = pickle.load(f) ModuleNotFoundError: No module named 'xgboost'
这个错误是因为在你的代码中使用了XGBoost模型,但是你的Python环境中并没有安装XGBoost库。你需要在你的环境中安装XGBoost库,可以使用以下命令:
```
pip install xgboost
```
如果你使用的是conda环境,可以使用以下命令:
```
conda install -c anaconda py-xgboost
```
安装完成后,再次运行代码即可。
阅读全文
相关推荐















