Issue 1:
Checklist

[x ] I have included the output of celery -A proj report in the issue.

software -> celery:4.1.0 (latentcall) kombu:4.1.0 py:3.6.5
billiard:3.5.0.3 redis:2.10.6
platform -> system:Windows arch:64bit, WindowsPE imp:CPython
loader -> celery.loaders.app.AppLoader
settings -> transport:redis results:redis://localhost:6379/0
broker_url: 'redis://127.0.0.1:6379//'
result_backend: 'redis://localhost:6379/0'
include: ['base.tasks']

[ x] I have verified that the issue exists against the master branch of Celery.

Steps to reproduce

celery -A base.celery worker -P gevent

Expected behavior

runs

Actual behavior

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'

Changing Timer.init from this:

class Timer(_timer.Timer):
def __init__(self, *args, **kwargs):
from gevent.greenlet import Greenlet, GreenletExit

...to this:

class Timer(_timer.Timer):
def __init__(self, *args, **kwargs):
from gevent.greenlet import Greenlet
from greenlet import GreenletExit

...resolves the problem. After changing the import then celery -A base.celery worker -P gevent runs like it should.

-------------- celery@DESKTOP-7QUDBA4 v4.1.0 (latentcall)
---- **** -----
--- * *** * -- Windows-10-10.0.17134-SP0 2018-05-29 22:02:10
-- * - **** ---
- ** ---------- [config]
- ** ---------- .> app: base:0x205ee24df60
- ** ---------- .> transport: redis://127.0.0.1:6379//
- ** ---------- .> results: redis://localhost:6379/0
- *** --- * --- .> concurrency: 4 (gevent)
-- ******* ---- .> task events: OFF (enable -E to monitor tasks in this worker)
--- ***** -----
-------------- [queues]
.> celery exchange=celery(direct) key=celery

I'm running gevent==1.3.2 and greenlet==0.4.13

Issue 2:
Checklist

I have included the output of celery -A proj report in the issue.

(if you are not able to do this, then at least specify the Celery

version affected).

I have verified that the issue exists against the master branch of Celery.

Steps to reproduce

I'm using Python 3.5.2 with celery 4.1.0 and gevent 1.3.0

When launching a worker, it returns an ImportError on GreenletExit

celery worker --app=superset.sql_lab:celery_app --pool=gevent -Ofair

Expected behavior

The worker should launch.

Actual behavior

Celery is unable to launch the worker, it return this error:

/home/joao/Superset/lib/python3.5/site-packages/celery/init.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 gevent/gevent#1016

monkey.patch_all()

Loaded your LOCAL configuration at [/home/joao/Superset/superset_config.py]

/home/joaog/Superset/lib/python3.5/site-packages/flask_cache/jinja2ext.py:33: ExtDeprecationWarning: Importing flask.ext.cache is deprecated, use flask_cache instead.

from flask.ext.cache import make_template_fragment_key

Traceback (most recent call last):

File "/home/joao/superset/bin/celery", line 11, in

load_entry_point('celery==4.1.0', 'console_scripts', 'celery')()

...

...

...

File "/home/joao/Superset/lib/python3.5/site-packages/celery/concurrency/gevent.py", line 34, in init

from gevent.greenlet import Greenlet, GreenletExit

ImportError: cannot import name 'GreenletExit'

It appears the GreenletExit should be imported like this:

from gevent import GreenletExit