简体   繁体   中英

Why does my environment on AWS Elastic Beanstalk fail when installing the requirements.txt

I followed this guide on getting started with AWS beanstalk, although I am using different packages in my requirements.txt than those in this tutorial:

https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create-deploy-python-flask.html#python-flask-deploy

It all works until I get to where they tell me to create an environment and deploy my application to it by entering the following command at my local terminal, in the project root:

eb create flask-env

This starts a process that eventually fails. I check the logs on the Beanstalk app and find:

Downloading https://files.pythonhosted.org/packages/fe/42/bfe2e0857bc284cbe6a011d93f2a9ad58a22cb894461b199ae72cfef0f29/dill-0.2.9.tar.gz (150kB)
  Collecting docutils==0.14 (from -r /opt/python/ondeck/app/requirements.txt (line 16))
    Downloading https://files.pythonhosted.org/packages/36/fa/08e9e6e0e3cbd1d362c3bbee8d01d0aedb2155c4ac112b19ef3cae8eed8d/docutils-0.14-py3-none-any.whl (543kB)
  Collecting en-core-web-sm==2.0.0 (from -r /opt/python/ondeck/app/requirements.txt (line 17))
    Could not find a version that satisfies the requirement en-core-web-sm==2.0.0 (from -r /opt/python/ondeck/app/requirements.txt (line 17)) (from versions: )

It is obviously installing things from my requirements.txt package, and succeeds in installing a few. but when it gets to this line from requirements.txt:

en-core-web-sm==2.0.0

then it fails. I also noted this message in my logs, after the error message above:

You are using pip version 9.0.1, however version 19.0.1 is available.

My suspicion is the beanstalk environment is using an old version of pip by default, where this package (or package version) were not available.

Is this indeed the case? And if so, how do I tell it to use an upgraded version of pip. i can ssh into the ec2 instance the application is on, but i'm not sure if that is the best way to force it to use an updated version of pip in virtual environments.

It seems that to install this module you need to install spacy .

pip install spacy
spacy download en_core_web_sm

Found a documentation here: https://spacy.io/models/en

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM