title: Trouble Installing Gevent In Python 3.5
body: <p>I'm trying to install Gevent in Python 3.5 in PyCharm.  I've had no problems installing it in 2.7.  But it will not work in 3.4 or 3.5.</p>
  
  <p>Here's the error I'm getting:</p>
  
  <pre><code>TypeError: unsupported operand type(s) for &gt;&gt;: 'builtin_function_or_method' and '_io.TextIOWrapper'
  </code></pre>
  
  <p>I've tried installing directly using pip &amp; easy install.  Here's the error I get:</p>
  
  <pre><code>localhost:~ user$ Python3.5 easy_install gevent
  /Library/Frameworks/Python.framework/Versions/3.5/Resources/Python.app/Contents/MacOS/Python: can't open file 'easy_install': [Errno 2] No such file or directory
  
  localhost:~ user$ Python3.5 pip install gevent
  /Library/Frameworks/Python.framework/Versions/3.5/Resources/Python.app/Contents/MacOS/Python: can't open file 'pip': [Errno 2] No such file or directory
  </code></pre>
  
  <p>I've tried moving from 2.7 to 3.5 using the steps outlined here:</p>
  
  <p><a href="https://wolfpaulus.com/journal/mac/installing_python_osx/" rel="nofollow">https://wolfpaulus.com/journal/mac/installing_python_osx/</a></p>
  
  <p>Still no luck getting it to work on 3.5. </p>
  
  <p>I've tried downloading gevent &amp; running the setup.py in Python Launcher 3.5.  Here's the error that gives:</p>
  
  <pre><code>cd '/Users/user/Downloads/gevent-master/' &amp;&amp; '/usr/bin/pythonw'  '/Users/user/Downloads/gevent-master/setup.py'  &amp;&amp; echo Exit status: $? &amp;&amp; exit 1
  localhost:~ user$ cd '/Users/user/Downloads/gevent-master/' &amp;&amp; '/usr/bin/pythonw'  '/Users/user/Downloads/gevent-master/setup.py'  &amp;&amp; echo Exit status: $? &amp;&amp; exit 1
  Running 'make ' in /Users/user/Downloads/gevent-master
  /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python util/cythonpp.py -o gevent.corecext.c gevent/core.ppyx
  Running cython -o gevent.corecext.c gevent/core.pyx  # !EV_USE_SIGNALFD &amp;&amp; !defined(LIBEV_EMBED) &amp;&amp; !defined(_WIN32)
  sh: cython: command not found
  Path: /opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/usr/local/git/bin:/usr/local/MacGPG2/bin
  Bin: /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS files: Python
  Traceback (most recent call last):
    File "util/cythonpp.py", line 789, in &lt;module&gt;
      process_filename(filename, options.output_file)
    File "util/cythonpp.py", line 98, in process_filename
      output = run_cython(pyx_filename, sourcehash, output_filename, banner, comment)
    File "util/cythonpp.py", line 546, in run_cython
      system(command, comment)
    File "util/cythonpp.py", line 562, in system
      raise AssertionError('%r failed with code %s' % (command, result))
  AssertionError: 'cython -o gevent.corecext.c gevent/core.pyx' failed with code 32512
  make: *** [gevent/gevent.corecext.c] Error 1
  Traceback (most recent call last):
    File "/Users/user/Downloads/gevent-master/setup.py", line 426, in &lt;module&gt;
      run_setup(ext_modules, run_make=run_make)
    File "/Users/user/Downloads/gevent-master/setup.py", line 378, in run_setup
      make()
    File "/Users/user/Downloads/gevent-master/setup.py", line 232, in make
      system('make ' + targets)
    File "/Users/user/Downloads/gevent-master/setup.py", line 142, in system
      if _system(cmd):
    File "/Users/user/Downloads/gevent-master/setup.py", line 138, in _system
      return check_call(cmd, shell=True)
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 540, in check_call
      raise CalledProcessError(retcode, cmd)
  subprocess.CalledProcessError: Command 'make ' returned non-zero exit status 2
  localhost:gevent-master user$ 
  </code></pre>
  
  <p>Here's the full error when trying to install gevent in PyCharm:</p>
  
  <pre><code>DEPRECATION: --no-install, --no-download, --build, and --no-clean are deprecated.  See https://github.com/pypa/pip/issues/906.
  Downloading/unpacking gevent
    Running setup.py (path:/private/var/folders/t4/xp7tp60132xfvpcsglylyyjr0000gn/T/pycharm-packaging0.tmp/gevent/setup.py) egg_info for package gevent
  
  Downloading/unpacking greenlet&gt;=0.4.7 (from gevent)
    Running setup.py (path:/private/var/folders/t4/xp7tp60132xfvpcsglylyyjr0000gn/T/pycharm-packaging0.tmp/greenlet/setup.py) egg_info for package greenlet
  
  Installing collected packages: gevent, greenlet
    Running setup.py install for gevent
      warning: build_py: byte-compiling is disabled, skipping.
  
      Running '/bin/sh /private/var/folders/t4/xp7tp60132xfvpcsglylyyjr0000gn/T/pycharm-packaging0.tmp/gevent/libev/configure &gt; configure-output.txt' in /private/var/folders/t4/xp7tp60132xfvpcsglylyyjr0000gn/T/pycharm-packaging0.tmp/gevent/build/temp.macosx-10.6-intel-3.4/libev
      Traceback (most recent call last):
        File "&lt;string&gt;", line 1, in &lt;module&gt;
        File "/private/var/folders/t4/xp7tp60132xfvpcsglylyyjr0000gn/T/pycharm-packaging0.tmp/gevent/setup.py", line 317, in &lt;module&gt;
          run_setup(ext_modules)
        File "/private/var/folders/t4/xp7tp60132xfvpcsglylyyjr0000gn/T/pycharm-packaging0.tmp/gevent/setup.py", line 312, in run_setup
          "Development Status :: 4 - Beta"])
        File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/distutils/core.py", line 148, in setup
          dist.run_commands()
        File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/distutils/dist.py", line 955, in run_commands
          self.run_command(cmd)
        File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/distutils/dist.py", line 974, in run_command
          cmd_obj.run()
        File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/setuptools-5.4.1-py3.4.egg/setuptools/command/install.py", line 61, in run
        File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/distutils/command/install.py", line 554, in run
          self.run_command('build')
        File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/distutils/cmd.py", line 313, in run_command
          self.distribution.run_command(command)
        File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/distutils/dist.py", line 974, in run_command
          cmd_obj.run()
        File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/distutils/command/build.py", line 126, in run
          self.run_command(cmd_name)
        File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/distutils/cmd.py", line 313, in run_command
          self.distribution.run_command(command)
        File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/distutils/dist.py", line 974, in run_command
          cmd_obj.run()
        File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/distutils/command/build_ext.py", line 348, in run
          self.build_extensions()
        File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/distutils/command/build_ext.py", line 457, in build_extensions
          self.build_extension(ext)
        File "/private/var/folders/t4/xp7tp60132xfvpcsglylyyjr0000gn/T/pycharm-packaging0.tmp/gevent/setup.py", line 234, in build_extension
          self.gevent_prepare(ext)
        File "/private/var/folders/t4/xp7tp60132xfvpcsglylyyjr0000gn/T/pycharm-packaging0.tmp/gevent/setup.py", line 231, in gevent_prepare
          configure(self, ext)
        File "/private/var/folders/t4/xp7tp60132xfvpcsglylyyjr0000gn/T/pycharm-packaging0.tmp/gevent/setup.py", line 139, in configure_libev
          make_universal_header('config.h', 'SIZEOF_LONG', 'SIZEOF_SIZE_T', 'SIZEOF_TIME_T')
        File "/private/var/folders/t4/xp7tp60132xfvpcsglylyyjr0000gn/T/pycharm-packaging0.tmp/gevent/setup.py", line 111, in make_universal_header
          print &gt;&gt;f, line
      TypeError: unsupported operand type(s) for &gt;&gt;: 'builtin_function_or_method' and '_io.TextIOWrapper'
      Complete output from command /Library/Frameworks/Python.framework/Versions/3.4/bin/python3.4 -c "import setuptools, tokenize;__file__='/private/var/folders/t4/xp7tp60132xfvpcsglylyyjr0000gn/T/pycharm-packaging0.tmp/gevent/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/t4/xp7tp60132xfvpcsglylyyjr0000gn/T/pip-tc4dbvhv-record/install-record.txt --single-version-externally-managed --compile:
      running install
  
  running build
  
  running build_py
  
  creating build
  
  creating build/lib.macosx-10.6-intel-3.4
  
  creating build/lib.macosx-10.6-intel-3.4/gevent
  
  copying gevent/__init__.py -&gt; build/lib.macosx-10.6-intel-3.4/gevent
  
  copying gevent/_ssl2.py -&gt; build/lib.macosx-10.6-intel-3.4/gevent
  
  copying gevent/_sslgte279.py -&gt; build/lib.macosx-10.6-intel-3.4/gevent
  
  copying gevent/_threading.py -&gt; build/lib.macosx-10.6-intel-3.4/gevent
  
  copying gevent/backdoor.py -&gt; build/lib.macosx-10.6-intel-3.4/gevent
  
  copying gevent/baseserver.py -&gt; build/lib.macosx-10.6-intel-3.4/gevent
  
  copying gevent/coros.py -&gt; build/lib.macosx-10.6-intel-3.4/gevent
  
  copying gevent/event.py -&gt; build/lib.macosx-10.6-intel-3.4/gevent
  
  copying gevent/fileobject.py -&gt; build/lib.macosx-10.6-intel-3.4/gevent
  
  copying gevent/greenlet.py -&gt; build/lib.macosx-10.6-intel-3.4/gevent
  
  copying gevent/hub.py -&gt; build/lib.macosx-10.6-intel-3.4/gevent
  
  copying gevent/local.py -&gt; build/lib.macosx-10.6-intel-3.4/gevent
  
  copying gevent/lock.py -&gt; build/lib.macosx-10.6-intel-3.4/gevent
  
  copying gevent/monkey.py -&gt; build/lib.macosx-10.6-intel-3.4/gevent
  
  copying gevent/os.py -&gt; build/lib.macosx-10.6-intel-3.4/gevent
  
  copying gevent/pool.py -&gt; build/lib.macosx-10.6-intel-3.4/gevent
  
  copying gevent/pywsgi.py -&gt; build/lib.macosx-10.6-intel-3.4/gevent
  
  copying gevent/queue.py -&gt; build/lib.macosx-10.6-intel-3.4/gevent
  
  copying gevent/resolver_ares.py -&gt; build/lib.macosx-10.6-intel-3.4/gevent
  
  copying gevent/resolver_thread.py -&gt; build/lib.macosx-10.6-intel-3.4/gevent
  
  copying gevent/select.py -&gt; build/lib.macosx-10.6-intel-3.4/gevent
  
  copying gevent/server.py -&gt; build/lib.macosx-10.6-intel-3.4/gevent
  
  copying gevent/socket.py -&gt; build/lib.macosx-10.6-intel-3.4/gevent
  
  copying gevent/ssl.py -&gt; build/lib.macosx-10.6-intel-3.4/gevent
  
  copying gevent/subprocess.py -&gt; build/lib.macosx-10.6-intel-3.4/gevent
  
  copying gevent/thread.py -&gt; build/lib.macosx-10.6-intel-3.4/gevent
  
  copying gevent/threading.py -&gt; build/lib.macosx-10.6-intel-3.4/gevent
  
  copying gevent/threadpool.py -&gt; build/lib.macosx-10.6-intel-3.4/gevent
  
  copying gevent/timeout.py -&gt; build/lib.macosx-10.6-intel-3.4/gevent
  
  copying gevent/util.py -&gt; build/lib.macosx-10.6-intel-3.4/gevent
  
  copying gevent/win32util.py -&gt; build/lib.macosx-10.6-intel-3.4/gevent
  
  copying gevent/wsgi.py -&gt; build/lib.macosx-10.6-intel-3.4/gevent
  
  warning: build_py: byte-compiling is disabled, skipping.
  
  
  
  running build_ext
  
  Running '/bin/sh /private/var/folders/t4/xp7tp60132xfvpcsglylyyjr0000gn/T/pycharm-packaging0.tmp/gevent/libev/configure &gt; configure-output.txt' in /private/var/folders/t4/xp7tp60132xfvpcsglylyyjr0000gn/T/pycharm-packaging0.tmp/gevent/build/temp.macosx-10.6-intel-3.4/libev
  
  Traceback (most recent call last):
  
    File "&lt;string&gt;", line 1, in &lt;module&gt;
  
    File "/private/var/folders/t4/xp7tp60132xfvpcsglylyyjr0000gn/T/pycharm-packaging0.tmp/gevent/setup.py", line 317, in &lt;module&gt;
  
      run_setup(ext_modules)
  
    File "/private/var/folders/t4/xp7tp60132xfvpcsglylyyjr0000gn/T/pycharm-packaging0.tmp/gevent/setup.py", line 312, in run_setup
  
      "Development Status :: 4 - Beta"])
  
    File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/distutils/core.py", line 148, in setup
  
      dist.run_commands()
  
    File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/distutils/dist.py", line 955, in run_commands
  
      self.run_command(cmd)
  
    File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/distutils/dist.py", line 974, in run_command
  
      cmd_obj.run()
  
    File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/setuptools-5.4.1-py3.4.egg/setuptools/command/install.py", line 61, in run
  
    File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/distutils/command/install.py", line 554, in run
  
      self.run_command('build')
  
    File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/distutils/cmd.py", line 313, in run_command
  
      self.distribution.run_command(command)
  
    File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/distutils/dist.py", line 974, in run_command
  
      cmd_obj.run()
  
    File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/distutils/command/build.py", line 126, in run
  
      self.run_command(cmd_name)
  
    File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/distutils/cmd.py", line 313, in run_command
  
      self.distribution.run_command(command)
  
    File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/distutils/dist.py", line 974, in run_command
  
      cmd_obj.run()
  
    File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/distutils/command/build_ext.py", line 348, in run
  
      self.build_extensions()
  
    File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/distutils/command/build_ext.py", line 457, in build_extensions
  
      self.build_extension(ext)
  
    File "/private/var/folders/t4/xp7tp60132xfvpcsglylyyjr0000gn/T/pycharm-packaging0.tmp/gevent/setup.py", line 234, in build_extension
  
      self.gevent_prepare(ext)
  
    File "/private/var/folders/t4/xp7tp60132xfvpcsglylyyjr0000gn/T/pycharm-packaging0.tmp/gevent/setup.py", line 231, in gevent_prepare
  
      configure(self, ext)
  
    File "/private/var/folders/t4/xp7tp60132xfvpcsglylyyjr0000gn/T/pycharm-packaging0.tmp/gevent/setup.py", line 139, in configure_libev
  
      make_universal_header('config.h', 'SIZEOF_LONG', 'SIZEOF_SIZE_T', 'SIZEOF_TIME_T')
  
    File "/private/var/folders/t4/xp7tp60132xfvpcsglylyyjr0000gn/T/pycharm-packaging0.tmp/gevent/setup.py", line 111, in make_universal_header
  
      print &gt;&gt;f, line
  
  TypeError: unsupported operand type(s) for &gt;&gt;: 'builtin_function_or_method' and '_io.TextIOWrapper'
  
  ----------------------------------------
  Cleaning up...
  Command /Library/Frameworks/Python.framework/Versions/3.4/bin/python3.4 -c "import setuptools, tokenize;__file__='/private/var/folders/t4/xp7tp60132xfvpcsglylyyjr0000gn/T/pycharm-packaging0.tmp/gevent/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/t4/xp7tp60132xfvpcsglylyyjr0000gn/T/pip-tc4dbvhv-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /private/var/folders/t4/xp7tp60132xfvpcsglylyyjr0000gn/T/pycharm-packaging0.tmp/gevent
  Storing debug log for failure in /Users/user/.pip/pip.log
  </code></pre>