from ...mqbasecrawl import BaseSpider ImportError: attempted relative import with no known parent package
时间: 2023-10-17 21:33:04 浏览: 166
根据你提供的信息,你遇到了一个Python相对路径导入的问题。具体报错信息是"ImportError: attempted relative import with no known parent package"。这个错误通常发生在使用相对导入时没有找到已知的父程序包。
解决这个问题的方法是,去掉"from ."导入,直接使用"import _convert"进行导入即可。这样就可以避免出现相对路径导入的问题。
希望我的回答对你有帮助。如果你有任何其他问题,请随时提问。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [Python报错:ImportError: attempted relative import with no known parent package](https://blog.csdn.net/m0_45521766/article/details/126513067)[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^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
- *2* [ import _convert 报错 ImportError: attempted relative import with no known parent packageuan](https://blog.csdn.net/qq_43293247/article/details/127900587)[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^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文