ModuleNotFoundError: No module named 'common'
时间: 2023-10-12 16:21:00 浏览: 593
单项选择题-python使用pip安装报错modulenotfounderror: no module named ‘pkg_resources’的解决方法
This error message indicates that the Python interpreter could not find a module named "common". This could happen for several reasons:
1. The module "common" is not installed on your system. You can try installing it using a package manager like pip or conda.
2. The module "common" is not in your Python path. You can check your Python path by running the following code:
```
import sys
print(sys.path)
```
This will print a list of directories where Python looks for modules. If the directory containing "common" is not in this list, you can add it using the following code:
```
import sys
sys.path.append('/path/to/common')
```
Replace "/path/to/common" with the actual path to the directory containing the "common" module.
3. The module "common" is in a subdirectory of your project, but you are not importing it correctly. Make sure you are using the correct import statement, e.g.:
```
from myproject.common import mymodule
```
Replace "myproject" and "mymodule" with the actual names of your project and module.
阅读全文