Deploying Python Flask app to Google App Engine - version errors

695 views
Skip to first unread message

Bjørn-Jostein Singstad

unread,
Sep 10, 2020, 9:20:18 AM9/10/20
to Google App Engine
I am trying to deploy a Python Flask application on Google Cloud Platform (App Engine). The app works fine locally on my computer. I use Tensorflow version 2.3.0 in my app. This seems to be a problem when I try to deploy the app to Google Cloud Platform. I get this error code in the build log when trying to build the app:


Collecting tensorflow==2.3.0 (from -r requirements.txt (line 2))
Step #1:   Could not find a version that satisfies the requirement tensorflow==2.3.0 (from -r requirements.txt (line 2)) (from versions: 0.12.1, 1.0.0, 1.0.1, 1.1.0rc0, 1.1.0rc1, 1.1.0rc2, 1.1.0
, 1.2.0rc0, 1.2.0rc1, 1.2.0rc2, 1.2.0, 1.2.1, 1.3.0rc0, 1.3.0rc1, 1.3.0rc2, 1.3.0, 1.4.0rc0, 1.4.0rc1, 1.4.0, 1.4.1, 1.5.0rc0, 1.5.0rc1, 1.5.0, 1.5.1, 1.6.0rc0, 1.6.0rc1, 1.6.0, 1.7.0rc0, 1.7.0r
c1, 1.7.0, 1.7.1, 1.8.0rc0, 1.8.0rc1, 1.8.0, 1.9.0rc0, 1.9.0rc1, 1.9.0rc2, 1.9.0, 1.10.0rc0, 1.10.0rc1, 1.10.0, 1.10.1, 1.11.0rc0, 1.11.0rc1, 1.11.0rc2, 1.11.0, 1.12.0rc0, 1.12.0rc1, 1.12.0rc2, 
1.12.0, 1.12.2, 1.12.3, 1.13.0rc0, 1.13.0rc1, 1.13.0rc2, 1.13.1, 1.13.2, 1.14.0rc0, 1.14.0rc1, 1.14.0, 2.0.0a0, 2.0.0b0, 2.0.0b1)
Step #1: No matching distribution found for tensorflow==2.3.0 (from -r requirements.txt (line 2))
Step #1: You are using pip version 10.0.1, however version 20.2.3 is available.
Step #1: You should consider upgrading via the 'pip install --upgrade pip' command.
Step #1: The command '/bin/sh -c pip install -r requirements.txt' returned a tanon-zero code: 1
Finished Step #1
ERROR
Step #1: 


In my YAML file i have specified that the app should run on Python 3.7:

entrypoint: "gunicorn -b:$PORT main:app"
env: flex
runtime: python
runtime_config: 
  python_version: 3.7

But for me it seems as python 2.7 also is involved in some way:

 ---> Running in b2db92615defStep #1: Running virtualenv with interpreter /opt/python3.7/bin/python3.7Step #1: Using base prefix '/opt/python3.7'Step #1: /usr/local/lib/python2.7/dist-packages/virtualenv.py:1041: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative usesStep #1: import impStep #1: New python executable in /env/bin/python3.7Step #1: Also creating executable in /env/bin/python  

My requirement file looks like this:
```
pip==20.2.3
tensorflow==2.3.0
Flask==0.11.1
gunicorn==19.5.0
numpy==1.17.4
scipy==1.4.1
h5py==2.10.0
```


I tried to update pip in the Google Cloud Shell before deploying the application and it seems to work ok, but when I deploy my app it goes back to the old pip version.

Dustin Ingram

unread,
Sep 10, 2020, 12:32:57 PM9/10/20
to google-a...@googlegroups.com
Using "python_version: 3.7" isn't valid, see https://cloud.google.com/appengine/docs/flexible/python/runtime#interpreter

In addition, the version of pip that you're using in Cloud Shell doesn't have an effect on the version of pip used when your application is deployed.

--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-appengi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/34417a89-10cc-440b-9821-65cf06d81422n%40googlegroups.com.


--
Give me feedback: go/tell-dustin
Reply all
Reply to author
Forward
0 new messages