Python中文
首页
教程
问答
标签
搜索
登录
注册
重要错误:没有命名的模块lop.型号
回答此问题可获得
20
贡献值,回答如果被采纳可获得
50
分。
<p>我知道有很多问题与此相关,但这些答案在我的情况下似乎行不通。我是django新手(我已经完成了教程),但我正在修复其他人的is代码(我无法再联系他)。在</p> <p>我在LinuxDerbian上运行Django1.5,使用Python2.7。 我收到了这个错误。在</p> <pre><code>File "views-full.py", line 1, in <module> from lop.models import File, V1, V2 ImportError: No module named lop.models. </code></pre> <p>我的观点-完整.py公司名称:</p> ^{pr2}$ <p>我的树是这样的(为了节省时间,我的观点-完整.py处于lop下):</p> <pre><code>Main ├── Main │ ├── __init__.py │ ├── __init__.pyc │ ├── settings.py │ ├── settings.pyc │ ├── urls.py │ ├── urls.pyc │ ├── wsgi.py │ └── wsgi.pyc ├── manage.py ├── lop │ ├── admin.py │ ├── admin.pyc │ ├── forms.py │ ├── forms.pyc │ ├── __init__.py │ ├── __init__.pyc │ ├── migrations │ │ ├── 0001_migrate.py │ │ ├── 0001_migrate.pyc │ │ ├── 0002_migrate.py │ │ ├── 0002_migrate.pyc │ │ ├── 0003_auto__add_category.py │ │ ├── 0003_auto__add_category.pyc │ │ ├── 0004_auto__add_field_script_category.py │ │ ├── 0004_auto__add_field_script_category.pyc │ │ ├── __init__.py │ │ └── __init__.pyc │ ├── models.py │ ├── models.pyc │ ├── tests.py │ ├── urls.py │ ├── urls.pyc │ ├── views │ │ ├── __init__.py │ │ ├── __init__.pyc │ │ ├── viewsb.py │ │ ├── viewsb.pyc │ │ └── viewsb.py.save │ ├── views-full.py │ ├── views.pyc │ ├── views.py.save │ └── views-test.py ├── scripts [39 entries exceeds filelimit, not opening dir] ├── sqlite3.db ├── static [29 entries exceeds filelimit, not opening dir] ├── templates │ ├── entry2-full.html │ ├── entry2.html │ ├── entry3-full.html │ ├── entry3.html │ ├── entry.html │ ├── index.html │ ├── index.html.old │ ├── scriptlist.html │ └── testData.html └── user-dirs [109 entries exceeds filelimit, not opening dir] </code></pre> <p>如您所见,我的<strong>init</strong>.py和模型.py都在同一个文件夹中(我知道在其他情况下没有问题)。在</p> <p>我的设置.py公司名称:</p> <pre><code> ... INSTALLED_APPS = ( 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.messages', 'django.contrib.staticfiles', 'django.contrib.admin', # 'django.contrib.admindocs', 'lop', 'south', ) ... </code></pre> <p>我觉得我犯了一些菜鸟的错误,但为了我的光明,我无法理解。这是我在这个网站上的第一个问题(请温柔一点)。提前谢谢。在</p>
0 条评论
分类:
Python问答
请先
登录
后评论
默认排序
时间排序
1 个回答
匿名
1天前
擅长:python、mysql、java
<p>我不熟悉django,但在这种情况下我会做些什么:</p> <pre><code>import sys sys.path.append('/path/of/folder/where/module/is/') from new_module import new_function </code></pre>
请先
登录
后评论
针对此问题:
更多的回答
关注
89
关注
收藏
1
收藏,
216
浏览
网友 提问于 2天前
相关Python问题
如何在python中从数据帧列中删除分类值?
2 回答
如何在python中从数据帧列表中删除引号
4 回答
如何在python中从数据帧创建列表
5 回答
如何在Python中从数据帧创建嵌套的JSON
2 回答
如何在Python中从数据帧显示wordcloud
2 回答
如何在Python中从数据帧的时间戳中删除字符
9 回答
如何在Python中从数据帧绘制简单绘图?
2 回答
如何在python中从数据帧行提取具有特定长度的范围?
7 回答
如何在python中从数据帧设置dict中的值
9 回答
如何在Python中从数据库中获得一个结果
5 回答
如何在python中从数据框中绘制分类条形图
5 回答
如何在Python中从数据框中选择特定细节?
1 回答
如何在python中从数据集中删除unicode
1 回答
如何在python中从数据集中删除某些数值?
9 回答
如何在python中从数据集中选择行
6 回答
如何在Python中从数组中删除元素
6 回答
如何在python中从数组中删除单个倒逗号?
1 回答
如何在python中从数组中删除对象?
8 回答
如何在python中从数组中删除引号
7 回答
如何在python中从数组中删除所有最小值
2 回答