<h2 dir="auto">Checklist</h2>
<ul dir="auto">
<li>
<p dir="auto">[x ] I have included the output of <code class="notranslate">celery -A proj report</code> in the issue.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="software -&gt; celery:4.1.0 (latentcall) kombu:4.1.0 py:3.6.5
        billiard:3.5.0.3 redis:2.10.6
platform -&gt; system:Windows arch:64bit, WindowsPE imp:CPython
loader   -&gt; celery.loaders.app.AppLoader
settings -&gt; transport:redis results:redis://localhost:6379/0
broker_url: 'redis://127.0.0.1:6379//'
result_backend: 'redis://localhost:6379/0'
include: ['base.tasks']"><pre class="notranslate"><code class="notranslate">software -&gt; celery:4.1.0 (latentcall) kombu:4.1.0 py:3.6.5
        billiard:3.5.0.3 redis:2.10.6
platform -&gt; system:Windows arch:64bit, WindowsPE imp:CPython
loader   -&gt; celery.loaders.app.AppLoader
settings -&gt; transport:redis results:redis://localhost:6379/0
broker_url: 'redis://127.0.0.1:6379//'
result_backend: 'redis://localhost:6379/0'
include: ['base.tasks']
</code></pre></div>
</li>
<li>
<p dir="auto">[ x] I have verified that the issue exists against the <code class="notranslate">master</code> branch of Celery.</p>
</li>
</ul>
<h2 dir="auto">Steps to reproduce</h2>
<p dir="auto"><code class="notranslate">celery -A base.celery worker -P gevent</code></p>
<h2 dir="auto">Expected behavior</h2>
<p dir="auto">runs</p>
<h2 dir="auto">Actual behavior</h2>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" File &quot;c:\programdata\miniconda3\envs\myenv\lib\site-packages\celery\concurrency\gevent.py&quot;, line 34, in __init__
    from gevent.greenlet import Greenlet, GreenletExit
ImportError: cannot import name 'GreenletExit'"><pre class="notranslate"><code class="notranslate"> File "c:\programdata\miniconda3\envs\myenv\lib\site-packages\celery\concurrency\gevent.py", line 34, in __init__
    from gevent.greenlet import Greenlet, GreenletExit
ImportError: cannot import name 'GreenletExit'
</code></pre></div>
<p dir="auto">Changing Timer.<strong>init</strong> from this:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="class Timer(_timer.Timer):
    def __init__(self, *args, **kwargs):
        from gevent.greenlet import Greenlet, GreenletExit"><pre class="notranslate"><code class="notranslate">class Timer(_timer.Timer):
    def __init__(self, *args, **kwargs):
        from gevent.greenlet import Greenlet, GreenletExit
</code></pre></div>
<p dir="auto">...to this:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="class Timer(_timer.Timer):
    def __init__(self, *args, **kwargs):
        from gevent.greenlet import Greenlet
        from greenlet import GreenletExit"><pre class="notranslate"><code class="notranslate">class Timer(_timer.Timer):
    def __init__(self, *args, **kwargs):
        from gevent.greenlet import Greenlet
        from greenlet import GreenletExit
</code></pre></div>
<p dir="auto">...resolves the problem.  After changing the import then <code class="notranslate">celery -A base.celery worker -P gevent</code> runs like it should.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" -------------- celery@DESKTOP-7QUDBA4 v4.1.0 (latentcall)
---- **** -----
--- * ***  * -- Windows-10-10.0.17134-SP0 2018-05-29 22:02:10
-- * - **** ---
- ** ---------- [config]
- ** ---------- .&gt; app:         base:0x205ee24df60
- ** ---------- .&gt; transport:   redis://127.0.0.1:6379//
- ** ---------- .&gt; results:     redis://localhost:6379/0
- *** --- * --- .&gt; concurrency: 4 (gevent)
-- ******* ---- .&gt; task events: OFF (enable -E to monitor tasks in this worker)
--- ***** -----
 -------------- [queues]
                .&gt; celery           exchange=celery(direct) key=celery"><pre class="notranslate"><code class="notranslate"> -------------- celery@DESKTOP-7QUDBA4 v4.1.0 (latentcall)
---- **** -----
--- * ***  * -- Windows-10-10.0.17134-SP0 2018-05-29 22:02:10
-- * - **** ---
- ** ---------- [config]
- ** ---------- .&gt; app:         base:0x205ee24df60
- ** ---------- .&gt; transport:   redis://127.0.0.1:6379//
- ** ---------- .&gt; results:     redis://localhost:6379/0
- *** --- * --- .&gt; concurrency: 4 (gevent)
-- ******* ---- .&gt; task events: OFF (enable -E to monitor tasks in this worker)
--- ***** -----
 -------------- [queues]
                .&gt; celery           exchange=celery(direct) key=celery
</code></pre></div>
<p dir="auto">I'm running gevent==1.3.2 and greenlet==0.4.13</p>
<h2 dir="auto">Checklist</h2>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have included the output of <code class="notranslate">celery -A proj report</code> in the issue.<br>
(if you are not able to do this, then at least specify the Celery<br>
version affected).</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have verified that the issue exists against the <code class="notranslate">master</code> branch of Celery.</li>
</ul>
<h2 dir="auto">Steps to reproduce</h2>
<p dir="auto">I'm using Python 3.5.2 with celery 4.1.0 and gevent 1.3.0<br>
When launching a worker, it returns an ImportError on GreenletExit</p>
<p dir="auto">celery worker --app=superset.sql_lab:celery_app --pool=gevent -Ofair</p>
<h2 dir="auto">Expected behavior</h2>
<p dir="auto">The worker should launch.</p>
<h2 dir="auto">Actual behavior</h2>
<p dir="auto">Celery is unable to launch the worker, it return this error:</p>
<p dir="auto">/home/joao/Superset/lib/python3.5/site-packages/celery/<strong>init</strong>.py:113: MonkeyPatchWarning: Monkey-patching ssl after ssl has already been imported may lead to errors, including RecursionError on Python 3.6. Please monkey-patch earlier. See <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="256694563" data-permission-text="Title is private" data-url="https://github.com/gevent/gevent/issues/1016" data-hovercard-type="issue" data-hovercard-url="/gevent/gevent/issues/1016/hovercard" href="https://github.com/gevent/gevent/issues/1016">gevent/gevent#1016</a><br>
monkey.patch_all()<br>
Loaded your LOCAL configuration at [/home/joao/Superset/superset_config.py]<br>
/home/joaog/Superset/lib/python3.5/site-packages/flask_cache/jinja2ext.py:33: ExtDeprecationWarning: Importing flask.ext.cache is deprecated, use flask_cache instead.<br>
from flask.ext.cache import make_template_fragment_key<br>
Traceback (most recent call last):<br>
File "/home/joao/superset/bin/celery", line 11, in <br>
load_entry_point('celery==4.1.0', 'console_scripts', 'celery')()<br>
...<br>
...<br>
...<br>
File "/home/joao/Superset/lib/python3.5/site-packages/celery/concurrency/gevent.py", line 34, in <strong>init</strong><br>
from gevent.greenlet import Greenlet, GreenletExit<br>
ImportError: cannot import name 'GreenletExit'</p>
<p dir="auto">It appears the GreenletExit should be imported like this:<br>
from gevent import GreenletExit</p>