AWS Elastic Beanstalk ModuleNotFoundError:没有名为'requests'的模块

时间:2019-05-13 06:30:27

标签: amazon-web-services python-requests amazon-elastic-beanstalk

我正在使用AWS Elastic Beanstalk环境,并且收到以下消息:

[Mon May 13 12:38:41.784799 2019] [:error] [pid 3841] 
    ModuleNotFoundError: No module named 'requests'

该消息非常明显,并且我已将该模块添加到我的requirements.txt中,并且一切在我的机器上都可以正常运行,但在AWS环境下无法正常工作。

我只是想知道是否有任何技巧可以将模块导入AWS。

requirements.txt

certifi==2019.3.9
chardet==3.0.4
Django==2.1.7
django-cors-headers==2.5.2
django-extensions==2.1.6
django-filter==2.1.0
djangorestframework==3.9.2
idna==2.8
mysqlclient==1.4.2.post1
python-dateutil==2.8.0
pytz==2018.9
requests==2.21.0
six==1.12.0
text-unidecode==1.2
urllib3==1.24.3

.ebextensions / django.config

option_settings:
  aws:elasticbeanstalk:container:python:
    WSGIPath: entrypoint/wsgi.py
container_commands:
  01_wsgipass:
    command: 'echo "WSGIPassAuthorization On" >> ../wsgi.conf'

.elasticbeanstalk / config.yml

branch-defaults:
  master:
    environment: XXXXX
    group_suffix: null
environment-defaults:
  squirrel-api-env:
    branch: null
    repository: null
global:
  application_name: XXXXX
  branch: null
  default_ec2_keyname: api-key
  default_platform: python-3.6
  default_region: ap-southeast-2
  include_git_submodules: true
  instance_profile: null
  platform_name: null
  platform_version: null
  profile: eb-cli
  repository: null
  sc: git
  workspace_type: Application

0 个答案:

没有答案