Hi, I can’t deploy a flask app because of the following error:
Aug 14 10:03:55 AM Collecting secrets
Aug 14 10:03:55 AM Downloading secrets-1.0.2.tar.gz (7.9 kB)
Aug 14 10:03:55 AM ERROR: Command errored out with exit status 1:
Aug 14 10:03:55 AM command: /opt/render/project/src/.venv/bin/python3.9 -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-ql86avd3/secrets_d8bb1f2054b44774891ca775d5b41ed0/setup.py'"'"'; __file__='"'"'/tmp/pip-install-ql86avd3/secrets_d8bb1f2054b44774891ca775d5b41ed0/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-6x6g7gre
Aug 14 10:03:55 AM cwd: /tmp/pip-install-ql86avd3/secrets_d8bb1f2054b44774891ca775d5b41ed0/
Aug 14 10:03:55 AM Complete output (12 lines):
Aug 14 10:03:55 AM Traceback (most recent call last):
Aug 14 10:03:55 AM File "/tmp/pip-install-ql86avd3/secrets_d8bb1f2054b44774891ca775d5b41ed0/setup.py", line 10, in <module>
Aug 14 10:03:55 AM import OpenSSL
Aug 14 10:03:55 AM ModuleNotFoundError: No module named 'OpenSSL'
Aug 14 10:03:55 AM
Aug 14 10:03:55 AM During handling of the above exception, another exception occurred:
Aug 14 10:03:55 AM
Aug 14 10:03:55 AM Traceback (most recent call last):
Aug 14 10:03:55 AM File "<string>", line 1, in <module>
Aug 14 10:03:55 AM File "/tmp/pip-install-ql86avd3/secrets_d8bb1f2054b44774891ca775d5b41ed0/setup.py", line 12, in <module>
Aug 14 10:03:55 AM raise ImportError('Installing this module requires OpenSSL python bindings')
Aug 14 10:03:55 AM ImportError: Installing this module requires OpenSSL python bindings
My requements.txt looks like this
cryptography
pyOpenSSL
Flask
Gunicorn
pandas
werkzeug
requests
secrets
flask_sqlalchemy
scrypt
It seems that OpenSSL should first be installed in the server (so the bindings are created).
Everything runs smoothly on my local machine, with a clean virtual environment on which I run pip install -r requirements.txt.