ModuleNotFoundError: No module named 'decorator'
时间: 2023-08-17 15:13:06 浏览: 1917
这个错误是由于缺少名为'decorator'的模块导致的。根据引用\[1\],这个错误通常发生在使用'timeout_decorator'模块时。根据引用\[2\],这个问题通常发生在跟随教程或代码包练习时,因为这个模块不常用。根据引用\[3\],从numpy的1.18版本开始,numpy.testing.decorators模块已经被淘汰,取而代之的是numpy.testing模块。因此,解决这个问题的方法是将导入模块的代码从'timeout_decorator'改为'numpy.testing'。这样就可以解决ModuleNotFoundError: No module named 'decorator'的问题。
#### 引用[.reference_title]
- *1* [解决Traceback (most recent call last): File “train.py“, line 5, in <module> import timeout_deco](https://blog.csdn.net/qq_45378106/article/details/129909952)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* *3* [【不降级的解决方案】ModuleNotFoundError: No module named ‘numpy.testing.decorators](https://blog.csdn.net/link_in_csdn/article/details/124815024)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文