ModuleNotFoundError: No module named 'jd.settings'
时间: 2023-08-28 07:16:42 浏览: 109
根据引用内容,你在cmd中执行Python程序时遇到了`ModuleNotFoundError: No module named 'jd.settings'`的错误。这个错误通常是因为Python无法找到指定的模块。在你的引用中,提供了一种解决方法,即将相关路径添加到系统路径中。你可以尝试在Python程序中添加以下代码来解决这个问题:
```python
import sys
import os
curPath = os.path.abspath(os.path.dirname(__file__))
rootPath = os.path.split(curPath)[0]
sys.path.append(rootPath)
```
这段代码将当前脚本所在的路径添加到了系统路径中,从而使Python能够正确找到`jd.settings`模块。请确保你已经正确执行了这段代码,并且将其放置在导入相关模块之前。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [python程序在命令行执行提示ModuleNotFoundError: No module named 'XXX' 解决方法](https://blog.csdn.net/weixin_30843605/article/details/96017325)[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^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
- *2* [django报错:ModuleNotFoundError: No module named 'redis_sessions'](https://blog.csdn.net/Darkman_EX/article/details/86629623)[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^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文