Python 在Elastic Beanstalk上部署时找不到模块Django

Python 在Elastic Beanstalk上部署时找不到模块Django,python,django,amazon-ec2,amazon-elastic-beanstalk,Python,Django,Amazon Ec2,Amazon Elastic Beanstalk,我正在尝试在Elastic Beanstalk上部署此存储库的后端。 我是Django的新手,我成功地完成了两个教程,解释了如何在Elastic Beanstalk上部署Django: 我一直收到这样的消息:没有名为'django'的模块 这是我的文件结构的一部分,位于文件夹“firekit”中 02_python.config option_settings: "aws:elasticbeanstalk:application:environment": DJANGO_SETTINGS_

我正在尝试在Elastic Beanstalk上部署此存储库的后端。 我是Django的新手,我成功地完成了两个教程,解释了如何在Elastic Beanstalk上部署Django:

我一直收到这样的消息:没有名为'django'的模块

这是我的文件结构的一部分,位于文件夹“firekit”中

02_python.config

option_settings:
"aws:elasticbeanstalk:application:environment":
  DJANGO_SETTINGS_MODULE: "settings"
  "PYTHONPATH": "/opt/python/current/app:$PYTHONPATH"
  "aws:elasticbeanstalk:container:python":
    WSGIPath: backend/wsgi.py
后端/wsgi.py

import os
import sys    

sys.path.insert(0, '/opt/python/current/app')
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")

from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
你知道我为什么一直出现“没有模块名为'django'”的错误消息吗?非常感谢你的帮助

编辑

requirements.txt

boto==2.38.0
celery[redis]==3.1.17
cssutils==1.0.1
django-bitfield==1.7.1
Django==1.7.3
djorm-pgarray==1.2.0
dnspython==1.12.0
fabric==1.10.1
hiredis==0.1.5
Pillow==3.0.0
premailer==1.3.0
psycopg2==2.5.4
pycrypto==2.6.1
pylint==0.28.0
python-memcached==1.53
redis==2.10.3
requests==2.5.3
sqlalchemy==0.9.8
tweepy==3.3.0
ua-parser==0.3.6
当我在本地运行
pip freeze
时,它会显示:

amqp==1.4.9
ansible==2.1.1.0
anyjson==0.3.3
awsebcli==3.7.8
beautifulsoup4==4.1.3
billiard==3.3.0.23
bleach==1.4
blessed==1.9.5
boto==2.38.0
botocore==1.4.61
Cartridge==0.9.4
celery==3.1.17
cement==2.8.2
cffi==1.8.3
colorama==0.3.7
cryptography==1.5.1
cssselect==0.9.1
cssutils==1.0.1
Django==1.7.3
django-bitfield==1.7.1
djorm-pgarray==1.2
dnspython==1.12.0
docker-py==1.7.2
dockerpty==0.4.1
docopt==0.6.2
docutils==0.12
enum34==1.1.6
Fabric==1.10.1
filebrowser-safe==0.3.5
future==0.9.0
gnureadline==6.3.3
grappelli-safe==0.3.12
hiredis==0.1.5
html5lib==0.999
idna==2.1
image==1.2
ipaddress==1.0.17
ipython==2.0.0
Jinja2==2.8
jmespath==0.9.0
kombu==3.0.37
logilab-astng==0.24.3
logilab-common==1.2.2
lxml==3.3.0
MarkupSafe==0.23
matplotlib==1.4.0
mercurial==3.7.1+20160203
Mezzanine==3.1.8
mock==1.0.1
MySQL-python==1.2.5
nose==1.3.4
numpy==1.9.0
oauthlib==0.6.3
pandas==0.14.1
paramiko==2.0.2
pathspec==0.3.4
PIL==1.1.7
Pillow==3.0.0
premailer==1.3.0
psycopg2==2.5.4
pyasn1==0.1.9
pycparser==2.14
pycrypto==2.6.1
pylint==0.28.0
pymongo==2.7
PyMySQL==0.6.2
pyparsing==2.0.2
PyPDF2==1.22
python-dateutil==2.5.3
python-magic==0.4.12
python-memcached==1.53
pytz==2014.4
PyYAML==3.12
queuelib==1.1.1
redis==2.10.3
reportlab==3.1.8
requests==2.9.1
requests-oauthlib==0.4.1
s3cmd==1.6.1
Scrapy==0.22.0
semantic-version==2.5.0
six==1.10.0
SQLAlchemy==0.9.8
texttable==0.8.4
tweepy==3.3.0
tzlocal==1.0
ua-parser==0.3.6
vboxapi==1.0
virtualenv==15.0.3
w3lib==1.5
wcwidth==0.1.7
websocket-client==0.37.0
xhtml2pdf==0.0.6
我尝试了这两种配置,但始终出现相同的错误

EDIT2

还是有同样的错误吗

我在EB中做了ssh。 查找网站包。 已将找到的所有路径添加到wsgi.py

/opt/python/run/baselinenv/lib64/python3.4/site-packages
/opt/python/run/baselinenv/lib/python3.4/site-packages
/opt/python/run/venv/lib64/python3.4/site-packages
/opt/python/run/venv/lib/python3.4/site-packages
/usr/lib64/python2.7/site-packages
/usr/lib/python2.7/site-packages
/usr/local/lib64/python3.4/site-packages
/usr/local/lib64/python2.7/site-packages
/usr/local/lib/python3.4/site-packages
/usr/local/lib/python2.7/site-packages

这是非常古老的,但我也经历过同样的事情。我发现我的应用程序没有使用我正在部署的更改进行更新,原因是我在文件夹中使用git,并且我没有提交这些更改,因此部署继续部署以前提交的代码


以防万一有人正经历我今天经历的那个兔子洞。

您的requirements.txt文件中有什么内容?添加了requirements.txt签出:。您可能还需要wsgi.py中的虚拟环境路径。谢谢!我如何知道我的虚拟环境路径是什么?您可以通过SSH连接到EB实例进行验证,但如果我理解了其他文章,它始终是相同的路径。
/opt/python/run/baselinenv/lib64/python3.4/site-packages
/opt/python/run/baselinenv/lib/python3.4/site-packages
/opt/python/run/venv/lib64/python3.4/site-packages
/opt/python/run/venv/lib/python3.4/site-packages
/usr/lib64/python2.7/site-packages
/usr/lib/python2.7/site-packages
/usr/local/lib64/python3.4/site-packages
/usr/local/lib64/python2.7/site-packages
/usr/local/lib/python3.4/site-packages
/usr/local/lib/python2.7/site-packages