我正在尝试在django中设置我的项目,文件夹结构似乎很好。但是,在运行该命令时,我得到一个导入错误:没有名为wmicodes.makes的模块。所以我进入了回溯,发现了一些文件,这些文件引导我找到了它。这是文件。python manage.py runservermyfolder/myfolder/somename/models/base.py#other importsfrom wmicodes.makes import InternalMake # i get the error on this particular line#other imports'''The rest of the code'''这是另一个文件 myfolder/myfolder/somename/models/init.pyfrom .base import *#other imports这是回溯:Traceback (most recent call last): File "/home/mayureshkadam/Desktop/myfolder/venv/local/lib/python2.7/site-packages/django/utils/autoreload.py", line 226, in wrapper fn(*args, **kwargs) File "/home/mayureshkadam/Desktop/myfolder/venv/local/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 109, in inner_run autoreload.raise_last_exception() File "/home/mayureshkadam/Desktop/myfolder/venv/local/lib/python2.7/site-packages/django/utils/autoreload.py", line 249, in raise_last_exception six.reraise(*_exception) File "/home/mayureshkadam/Desktop/myfolder/venv/local/lib/python2.7/site-packages/django/utils/autoreload.py", line 226, in wrapper fn(*args, **kwargs) File "/home/mayureshkadam/Desktop/myfolder/venv/local/lib/python2.7/site-packages/django/__init__.py", line 18, in setup apps.populate(settings.INSTALLED_APPS) File "/home/mayureshkadam/Desktop/myfolder/venv/local/lib/python2.7/site-packages/django/apps/registry.py", line 108, in populate app_config.import_models(all_models) File "/home/mayureshkadam/Desktop/myfolder/venv/local/lib/python2.7/site-packages/django/apps/config.py", line 202, in import_models self.models_module = import_module(models_module_name) File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module我尝试找到错误,但失败了。任何指针都会有所帮助。谢谢!
1 回答
婷婷同学_
TA贡献1844条经验 获得超8个赞
所以我自己找到了答案。我试图找到内部内存的位置,我得到了一个python文件,我复制了绝对路径并将其包含在我的代码中
from absolute path import InternalMakes
这一行解决了我的错误。
添加回答
举报
0/150
提交
取消