2015-11-13 54 views
0

我使用的是當前版本(Celery 3.1.19,Billiard 3.3.0.21),無法將我的Django站點成功部署到AWS Elastic Beanstalk。Celery(Django)ImportError:沒有名爲billiard.exceptions的模塊

我想弄清楚這是一個WSGI問題,系統路徑問題,應用程序問題等。我有網站的工作,但我升級了芹菜和其他小包以及亞馬遜的AMI(在同一時間...不適合調試)。

這是堆棧跟蹤:

Target WSGI script '/opt/python/current/app/mysite/wsgi.py' cannot be loaded as Python module. 
Exception occurred processing WSGI script '/opt/python/current/app/mysite/wsgi.py'. 
Traceback (most recent call last): 
File "/opt/python/current/app/mysite/wsgi.py", line 23, in <module> 
    application = get_wsgi_application() 
File "/opt/python/run/venv/lib/python2.7/site-packages/django/core/wsgi.py", line 14, in get_wsgi_application 
    django.setup() 
File "/opt/python/run/venv/lib/python2.7/site-packages/django/__init__.py", line 17, in setup 
    configure_logging(settings.LOGGING_CONFIG, settings.LOGGING) 
File "/opt/python/run/venv/lib/python2.7/site-packages/django/conf/__init__.py", line 48, in __getattr__ 
    self._setup(name) 
File "/opt/python/run/venv/lib/python2.7/site-packages/django/conf/__init__.py", line 44, in _setup 
    self._wrapped = Settings(settings_module) 
File "/opt/python/run/venv/lib/python2.7/site-packages/django/conf/__init__.py", line 92, in __init__ 
    mod = importlib.import_module(self.SETTINGS_MODULE) 
File "/usr/lib64/python2.7/importlib/__init__.py", line 37, in import_module 
    __import__(name) 
File "/opt/python/current/app/mysite/__init__.py", line 5, in <module> 
    from .celery import app as celery_app 
File "/opt/python/current/app/mysite/celery.py", line 3, in <module> 
    from celery import Celery 
File "/opt/python/run/venv/lib/python2.7/site-packages/celery/five.py", line 306, in __getattr__ 
    module = __import__(self._object_origins[name], None, None, [name]) 
File "/opt/python/run/venv/lib/python2.7/site-packages/celery/app/__init__.py", line 14, in <module> 
    from celery import _state 
File "/opt/python/run/venv/lib/python2.7/site-packages/celery/_state.py", line 20, in <module> 
    from celery.utils.threads import LocalStack 
File "/opt/python/run/venv/lib/python2.7/site-packages/celery/utils/__init__.py", line 27, in <module> 
    from celery.exceptions import CPendingDeprecationWarning, CDeprecationWarning 
File "/opt/python/run/venv/lib/python2.7/site-packages/celery/exceptions.py", line 15, in <module> 
    from billiard.exceptions import ( # noqa 
ImportError: No module named billiard.exceptions 
AH00124: Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace. 

只是前行application = get_wsgi_application()我打印sys.path

['/opt/python/run/venv/lib/python2.7/site-packages', 
'/opt/python/current/app', 
'', 
'/opt/python/run/baselinenv/local/lib64/python2.7/site-packages', 
'/opt/python/run/baselinenv/local/lib/python2.7/site-packages', 
'/opt/python/run/baselinenv/lib64/python2.7', 
'/opt/python/run/baselinenv/lib/python2.7', 
'/opt/python/run/baselinenv/lib64/python2.7/site-packages', 
'/opt/python/run/baselinenv/lib/python2.7/site-packages', 
'/opt/python/run/baselinenv/lib64/python2.7/lib-dynload', 
'/usr/lib64/python2.7', 
'/usr/lib/python2.7'] 

在我wsgi.conf:

WSGIPythonHome /opt/python/run/baselinenv 

任何指導甚至在哪裏開始調試將是有益的。

+0

http://stackoverflow.com/questions/33661818/python-virtualenv-importerror-with-celery-and-billiard/33687828#33687828這是一個類似的問題 –

回答

1

問題是我的WSGIDaemonProcesspython-path在我的wsgi.conf。除了正常的lib目錄外,我還必須添加對lib64的引用。

python-path=/opt/python/current/app:/opt/python/run/venv/lib/python2.7/site-packages:/opt/python/run/venv/lib64/python2.7/site-packages 
+0

,像變魔術一樣! – Farcorn

相關問題