I have a Flask web service using a Python library PyDDE, which is distributed on PyPI but somehow can't be pip installed. I can install this library on my local environment using pip install git+https://github.com/hensing/PyDDE.git
or clone and install setup.py
.
But when I tried to upload and build the project on either AWS Elastic Beanstalk or Google App Engine Flexible Environment, this becomes an issue that they can't find a matching distribution of this library.
Is there any workaround to solve this issue?
Here is the error message from GAE Flexible:
Step #1: Could not find a version that satisfies the requirement PyDDE (from -r requirements.txt (li
ne 7)) (from versions: )
Step #1: No matching distribution found for PyDDE (from -r requirements.txt (line 7))
Step #1: The command '/bin/sh -c pip install -r requirements.txt' returned a non-zero code: 1
Finished Step #1
ERROR
ERROR: build step "gcr.io/cloud-builders/docker@sha256:331786b295647a4560ed004a46761ee91409e754df7ffa7
54a67000bd020729a" failed: exit status 1
Step #1:
------------------------------------------------------------------------------------------------------
ERROR: (gcloud.app.deploy) Cloud build failed. Check logs at https://console.cloud.google.com/gcr/buil
ds/6ace1019-8bf5-434b-b916-5c6cae84de9f?project=project-190120 Failure status: UNKNOWN: Err
or Response: [2] Build failed; check build logs for details
And here is my requirements.txt
:
Flask==0.12.2
Werkzeug==0.12.2
gunicorn==19.7.1
pandas>0.20.0
numpy>1.13.0
scipy>0.19.0
PyDDE
google-api-python-client
UPDATE:
I added this line in requirements.txt
:
-e git+git://github.com/hensing/PyDDE.git#egg=PyDDE
And it works for GAE.
Thank you @hansaplast !!
However, AWS Elastic Beanstalk doesn't accept this requirements.txt
. It throws this error:
INFO: Created CloudWatch alarm named: awseb-e-3tu2ajdxug-stack-AWSEBCloudwatchAlarmLow-8NOPISSRAAEH
ERROR: Your requirements.txt is invalid. Snapshot your logs for details.
ERROR: [Instance: i-03e92fa3c58b6e010] Command failed on instance. Return code: 1 Output: (TRUNCATED).
..)
File "/usr/lib64/python2.7/subprocess.py", line 541, in check_call
raise CalledProcessError(retcode, cmd)
CalledProcessError: Command '/opt/python/run/venv/bin/pip install -r /opt/python/ondeck/app/requirements.txt' returned non-zero exit status 2.
Hook /opt/elasticbeanstalk/hooks/appdeploy/pre/03deploy.py failed. For more detail, check /var/log/eb-activity.log using console or EB CLI.
INFO: Command execution completed on all instances. Summary: [Successful: 0, Failed: 1].
ERROR: Create environment operation is complete, but with errors. For more information, see troubleshooting documentation.