scurrie
scurrie

Reputation: 403

Deploying Django app to Elasticbeanstalk: Error installing packages with Pip

I have been trying and failing to deploy a Django 1.7 app using Python 3.4 to elastic-beanstalk. Using Eb-Cli the following deploy creates an error:

eb deploy

Gives me:

CalledProcessError: Command '/opt/python/run/venv/bin/pip install -r /opt/python/ondeck/app/requirements.txt' returned non-zero exit status 2.

Checking the logs, I see the following:

CalledProcessError: Command '/opt/python/run/venv/bin/pip install -r /opt/python/ondeck/app/requirements.txt' returned non-zero exit status 2 (ElasticBeanstalk::ExternalInvocationError) caused by: You are using pip version 7.0.3, however version 7.1.2 is available.

Seeing this error I connected to the EC2 instance using ssh and tried to manually update pip; this however gave me a permissions error

Permission denied: '/usr/bin/pip'

It seems a little strange that an out of date pip is causing deployment to fail but could that be the case? And if it is, any ideas on how to update pip?

Some web searches lead me to believe that using Python 3.x could also be the problem but I haven't found any official documentation on this. Is EC2 simply not supporting python 3 yet?

Thanks

Upvotes: 1

Views: 694

Answers (1)

scurrie
scurrie

Reputation: 403

If anyone is curious; the solution to the issue was to change the encoding on my requirements.txt file. It took a lot of digging to figure this out; my guess is that the pip upgrade message was echo'd to the logs as soon as pip failed and the real error message was buried too many characters in to get reported.

Anyways, save requirements.txt with ANSI encoding and you should be good to go.

Upvotes: 1

Related Questions