question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

gunicorn==19.8.1 does not work on Python 3.7

See original GitHub issue

PR #8309 recently declared Python 3.7 as supported. But, superset has a stated install_requires of gunicorn<19.9.0 (fixed at gunicorn==19.8.1 in requirements.txt).

gunicorn<19.9.0 has a module named gunicorn.workers.async that is not valid in Python 3.7 (benoitc/gunicorn#1795). This was fixed in gunicorn 19.9.0. Superset should be updated to at least gunicorn 19.9.0 for Python 3.7 compatibility.

Expected results

apache-superset 0.34.0 should run under Python 3.7.

Actual results

Running superset through gunicorn produces an error.

/ # gunicorn \
>       -w 10 \
>       -k gevent \
>       --timeout 120 \
>       -b  0.0.0.0:6666 \
>       --limit-request-line 0 \
>       --limit-request-field_size 0 \
>       --statsd-host localhost:8125 \
>       superset:app

Error: class uri 'gevent' invalid or not found: 

[Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/gunicorn/util.py", line 135, in load_class
    mod = import_module('.'.join(components))
  File "/usr/local/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 724, in exec_module
  File "<frozen importlib._bootstrap_external>", line 860, in get_code
  File "<frozen importlib._bootstrap_external>", line 791, in source_to_code
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/usr/local/lib/python3.7/site-packages/gunicorn/workers/ggevent.py", line 30
    from gunicorn.workers.async import AsyncWorker
                              ^
SyntaxError: invalid syntax
]

Screenshots

N/A

How to reproduce the bug

  1. On Python 3.7, use pip to install apache-superset==0.34.0
  2. Use gunicorn to run superset as described on A proper WSGI HTTP Server.

Environment

(please complete the following information):

  • superset version: Superset 0.34.0
  • python version: Python 3.7.4
  • node.js version: N/A
  • npm version: N/A

Checklist

Make sure these boxes are checked before submitting your issue - thank you!

  • I have checked the superset logs for python stacktraces and included it here as text if there are any.
  • I have reproduced the issue with at least the latest released version of superset.
  • I have checked the issue tracker for the same issue and I haven’t found one similar.

Additional context

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
villebrocommented, Oct 4, 2019

Uhh, thanks for pointing this out. Shows that dev envs tend to not be very representative of prod. Gunicorn 19.9.0 has a serious regression that makes it not work for SSL terminated LBs. There has been a github issue collecting cherries for a 19.9.1 since April ( https://github.com/benoitc/gunicorn/issues/2022 ), but unfortunately that release is still pending. However, there seems to be renewed momentum ( https://github.com/benoitc/gunicorn/pull/2114 ), so perhaps this will be resolved soon. If not, I propose deprecating gunicorn and moving on to some other framework.

0reactions
villebrocommented, Oct 10, 2019

Sure thing @tilgovi , I’ll post my results on the PR thread.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to get Gunicorn to use Python 3 instead of Python 2 (502 ...
It seems that there's a package for this called gunicorn3 (this was tested on ubuntu). sudo apt-get install gunicorn3.
Read more >
Configure Python 3, Flask and Gunicorn on Ubuntu 18.04 LTS
In this tutorial we will get Python 3.6 configured with development system packages to start a new Flask web application project and run...
Read more >
Can't Run Gevent on Python3.7 - Google Groups
I am trying to run gevent for my Python 3.7.0b3 virtual env (ubuntu-1804) I am getting the following error. Error: class uri 'gevent'...
Read more >
1344674 – Harmless warning showed during gunicorn install
Description of problem: This issue was found in python-27-rhel7 Docker container, while installing the gunicorn package using pip: ...
Read more >
6. How do I install custom Python libraries through the node ...
The advantage is that you do not pay the cost of installing a library if it is already installed. There is a reduction...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found