2017-05-20 47 views
0

我是AWS CLI USAGE的新手。所以,請明確解釋我的錯誤,以免我下次再犯這個錯誤。錯誤:您的requirements.txt無效。快照您的日誌以瞭解詳細信息

Here is my requirements.txt file :

appdirs==1.4.3 
    cssselect==1.0.1 
    dj-database-url==0.4.2 
    Django==1.11 
    django-ckeditor==5.2.2 
    Markdown==2.6.8 
    packaging==16.8 
    psycopg2==2.5.4 
    pyparsing==2.2.0 
    pytz==2017.2 
    six==1.10.0 

Here are my files inside .ebextensions directory :

  • django.config

    option_settings: 
        "aws:elasticbeanstalk:application:environment": 
        DJANGO_SETTINGS_MODULE: "awsbean.settings" 
        aws:elasticbeanstalk:container:python: 
        WSGIPath: cv_web/wsgi.py 
    
  • packages.config

    packages: 
        yum: 
        git: [] 
    
  • python.config

    container_commands: 
        01_migrate: 
        command: "python src/manage.py migrate --noinput" 
        leader_only: true 
    

And here is my config.yml file inside .ebextensions/.elasticbeanstalk :

branch-defaults: 
    default: 
     environment: environment 
    environment-defaults: 
     environment: 
     branch: null 
     repository: null 
    global: 
     application_name: cv_web 
     default_ec2_keyname: aws-eb2 
     default_platform: Python 3.4 
     default_region: ap-south-1 
     instance_profile: null 
     platform_name: null 
     platform_version: null 
     profile: eb-cli 
     sc: null 
     workspace_type: Application 
+0

也許相關:http://stackoverflow.com/questions/18554666/invalid-requirements-txt-on-deploying-django-app-to-aws-豆稈 – jarmod

+0

我試過了,但沒有幫助:-(@jarmod –

回答

0

有一個已知的問題psycopg2在AWS上。你必須手動sudo安裝它。

我最常做的是我包括psycopg2安裝(安裝reqires第一postgressql-devel)的.ebextensions所以要確保它之前requirements.txt揭開序幕的可用。

這包括在你的配置文件:

container_commands: 
    01_postgresql: 
    command: sudo yum -y install gcc python-setuptools python-devel postgresql-devel 
    02_postgresql: 
    command: sudo easy_install psycopg2 
相關問題