1

I developed a Django application that works perfectly fine locally, but when I tried to deploy it in google cloud, I got the following error:

https://files.pythonhosted.org/packages/74/68/d87d9b36af36f44254a8d512cbfc48369103a3b9e474be9bdfe536abfc45/python_dateutil-2.7.5-py2.py3-none-any.whl (225kB)
Step #1 - "builder": Saved /tmp/tmpvTXqe6/wheel/python_dateutil-2.7.5-py2.py3-none-any.whl
Step #1 - "builder": Collecting pytz==2018.7 (from -r requirements.txt (line 57))
Step #1 - "builder": Downloading https://files.pythonhosted.org/packages/f8/0e/2365ddc010afb3d79147f1dd544e5ee24bf4ece58ab99b16fbb465ce6dc0/pytz-2018.7-py2.py3-none-any.whl (506kB)
Step #1 - "builder": Saved /tmp/tmpvTXqe6/wheel/pytz-2018.7-py2.py3-none-any.whl
Step #1 - "builder": Collecting pywin32==224 (from -r requirements.txt (line 58))
Step #1 - "builder":
Step #1 - "builder": INFO `pip_download_wheels` had stderr output:
Step #1 - "builder": Could not find a version that satisfies the requirement pywin32==224 (from -r requirements.txt (line 58)) (from versions: )
Step #1 - "builder": No matching distribution found for pywin32==224 (from -r requirements.txt (line 58))
Step #1 - "builder":
Step #1 - "builder": ERROR error: `pip_download_wheels` returned code: 1
Step #1 - "builder": INFO pip_download_wheels took 21 seconds
Step #1 - "builder": INFO build process for FTL image took 26 seconds
Step #1 - "builder": INFO full build took 26 seconds
Step #1 - "builder": ERROR `pip_download_wheels` had stderr output:
Step #1 - "builder": Could not find a version that satisfies the requirement pywin32==224 (from -r requirements.txt (line 58)) (from versions: )
Step #1 - "builder": No matching distribution found for pywin32==224 (from -r requirements.txt (line 58))
Step #1 - "builder":
Step #1 - "builder": error: `pip_download_wheels` returned code: 1
Step #1 - "builder": Traceback (most recent call last):
Step #1 - "builder": File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
Step #1 - "builder": "__main__", fname, loader, pkg_name)
Step #1 - "builder": File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
Step #1 - "builder": exec code in run_globals
Step #1 - "builder": File "/usr/local/bin/ftl.par/__main__.py", line 65, in <module>
Step #1 - "builder": File "/usr/local/bin/ftl.par/__main__.py", line 57, in main
Step #1 - "builder": File "/usr/local/bin/ftl.par/__main__/ftl/common/ftl_error.py", line 58, in UserErrorHandler
Step #1 - "builder": IOError: [Errno 2] No such file or directory: '""/output'
Finished Step #1 - "builder"
ERROR
ERROR: build step 1 "gcr.io/gae-runtimes/python37_app_builder:python37_20190527_3_7_3_RC00" failed: exit status 1

the app.yaml is as follow

**

runtime: python37
handlers:
- url: /static
  static_dir: static/
- url: /.*
  script: auto

**

and at the end this is the requirement.txt

altgraph==0.16.1
astroid==2.2.5`
autobahn==19.3.3
backcall==0.1.0
bleach==3.1.0
certifi==2018.10.15
chardet==3.0.4
colorama==0.4.1
cycler==0.10.0
decorator==4.3.0
defusedxml==0.6.0
Django==2.1.7
django-crispy-forms==1.7.2
entrypoints==0.3
future==0.17.1
idna==2.7
ipykernel==5.1.0
ipython==7.4.0
ipython-genutils==0.2.0
ipywidgets==7.4.2
isort==4.3.17
jedi==0.13.3
Jinja2==2.10.1
jsonschema==2.6.0
jupyter==1.0.0
jupyter-client==5.2.4
jupyter-console==6.0.0
jupyter-core==4.4.0
kiwisolver==1.0.1
lazy-object-proxy==1.3.1
macholib==1.11
MarkupSafe==1.1.1
matplotlib==3.0.2
mccabe==0.6.1
mistune==0.8.4
nbconvert==5.4.1
nbformat==4.4.0
notebook==5.7.8
numpy==1.15.4
opencv-python==3.4.3.18
pandocfilters==1.4.2
parso==0.4.0
pefile==2018.8.8
pickleshare==0.7.5
Pillow==6.0.0
plotly==3.4.1
prometheus-client==0.6.0
prompt-toolkit==2.0.9
Pygments==2.3.1
PyInstaller==3.4
pylint==2.3.1
pyparsing==2.3.0
pypiwin32==223
PyQt5==5.11.3
PyQt5-sip==4.19.13
python-dateutil==2.7.5
pytz==2018.7
pywin32==224
pywin32-ctypes==0.2.0
pywinpty==0.5.5
pyzmq==18.0.1
qtconsole==4.4.3
requests==2.20.1
retrying==1.3.3
scipy==1.1.0
Send2Trash==1.5.0
sip==4.19.8
six==1.11.0
sqlparse==0.3.0
terminado==0.8.2
testpath==0.4.2
tornado==6.0.2
traitlets==4.3.2
txaio==18.8.1
typed-ast==1.3.4
urllib3==1.24.1
virtualenv==16.7.5
vpnotebook==0.1.3
vpython==7.5.0
wcwidth==0.1.7
webencodings==0.5.1
widgetsnbextension==3.4.2
wrapt==1.11.1
xrandrl==0.1

I think that the error comes from the requirements, but i don't know how to solve it.

Give me your ideas please. I have been stuck with this issue for two days now.

fmw42
  • 46,825
  • 10
  • 62
  • 80
omar
  • 11
  • 2
  • 1
    Google Cloud is not going to support `PyWin32`, as that's a wrapper for the Windows API; can you remove it? – Ken Y-N Sep 20 '19 at 00:05
  • You can make it a conditional requirement, based on the platform, see https://stackoverflow.com/a/35614580/4495081 – Dan Cornilescu Sep 20 '19 at 01:34

1 Answers1

2

As you probably already know, Google´s App Engine servers are not running Windows, so there is no way to use the pywin32 API and there is no identical equivalent for it. So first of all, you will need to renounce using pywin32 and then, try to find equivalent libraries options for your desired use case.

You can also use conditional requirements, in your requirement.txt in order to be more specific about what you want to use. More information about the syntax of building conditional requirements can be found here.

Andrei Tigau
  • 2,010
  • 1
  • 6
  • 17