-1

我收到以下错误消息:

ImportError at /youtube_submit
No module named util.process
Request Method: GET
Request URL:    http://myapp.com:8000/youtube_submit?videoid=vSlF8EFo8QA
Django Version: 1.4.1
Exception Type: ImportError
Exception Value:    
No module named util.process
Exception Location: /Users/filipeximenes/Projects/trainee/trainee/views/youtube_submit.py in <module>, line 6
Python Executable:  /Users/filipeximenes/Projects/trainee/venv/bin/python
Python Version: 2.7.3
Python Path:    
['/Users/filipeximenes/Projects/trainee',
 '/Users/filipeximenes/Projects/trainee/venv/lib/python2.7/site-packages/distribute-0.6.27-py2.7.egg',
 '/Users/filipeximenes/Projects/trainee/venv/lib/python2.7/site-packages/pip-1.1-py2.7.egg',
 '/Users/filipeximenes/Projects/trainee/venv/lib/python27.zip',
 '/Users/filipeximenes/Projects/trainee/venv/lib/python2.7',
 '/Users/filipeximenes/Projects/trainee/venv/lib/python2.7/plat-darwin',
 '/Users/filipeximenes/Projects/trainee/venv/lib/python2.7/plat-mac',
 '/Users/filipeximenes/Projects/trainee/venv/lib/python2.7/plat-mac/lib-scriptpackages',
 '/Users/filipeximenes/Projects/trainee/venv/lib/python2.7/lib-tk',
 '/Users/filipeximenes/Projects/trainee/venv/lib/python2.7/lib-old',
 '/Users/filipeximenes/Projects/trainee/venv/lib/python2.7/lib-dynload',
 '/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7',
 '/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin',
 '/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk',
 '/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac',
 '/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages',
 '/Users/filipeximenes/Projects/trainee/venv/lib/python2.7/site-packages']

这是我的需求文件:

Django==1.4.1
South==0.7.6
amqplib==1.0.2
anyjson==0.3.3
billiard==2.7.3.12
celery==3.0.9
distribute==0.6.27
dj-database-url==0.2.1
django-celery==3.0.9
facebook-sdk==0.3.2
gdata==2.0.17
gunicorn==0.14.6
kombu==2.4.5
psycopg2==2.4.5
python-dateutil==1.5
python-openid==2.2.5
wsgiref==0.1.2

我在本地运行应用程序,并且我__init__.py的所有模块中都有文件。该应用程序已安装:

INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    # Uncomment the next line to enable the admin:
    'django.contrib.admin',
    # Uncomment the next line to enable admin documentation:
    'django.contrib.admindocs',
    'main',
    'trainee',
    'company',
    'videos',
    'south',
)

我有其他应用程序运行良好,唯一让我痛苦的是videos一个。

关于什么问题的任何想法?

编辑:

youtube 提交导入:
from videos.util.process import verify_video
process.py 导入:
from videos.util.youtube import YoutubeUtil
youtube.py 导入:
import gdata.youtube.service
import urlparse
from videos.util.verifier import Verifier
verifier.py 不导入任何内容

编辑:

我创建了另一个应用程序并将所有文件复制到它。我神奇地开始工作。

4

2 回答 2

0

我创建了另一个应用程序并将所有文件复制到它。不知何故,它现在正在工作。

于 2012-09-27T23:40:58.153 回答
0

在视频应用程序的 /youtube_submit 视图中,您导入了类似这样的内容,

from util.process import *

而且由于没有这样的模块或文件夹进程没有 __init__.py 文件,您会收到此错误

于 2012-09-13T13:39:56.883 回答