我试图在PyCharm中安装Python 3.5中的Gevent。我在2.7中安装它没有任何问题。但它不适用于3.4或3.5。
这是我得到的错误:
TypeError: unsupported operand type(s) for >>: 'builtin_function_or_method' and '_io.TextIOWrapper'
我尝试过使用pip&直接安装易于安装。这是我得到的错误:
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
我尝试使用此处列出的步骤从2.7移至3.5:
https://wolfpaulus.com/journal/mac/installing_python_osx/
仍然没有运气让它在3.5上工作。
我试过下载gevent&在Python Launcher 3.5中运行setup.py。这是给出的错误:
cd '/Users/user/Downloads/gevent-master/' && '/usr/bin/pythonw' '/Users/user/Downloads/gevent-master/setup.py' && echo Exit status: $? && exit 1
localhost:~ user$ cd '/Users/user/Downloads/gevent-master/' && '/usr/bin/pythonw' '/Users/user/Downloads/gevent-master/setup.py' && echo Exit status: $? && 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 && !defined(LIBEV_EMBED) && !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 <module>
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 <module>
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$
尝试在PyCharm中安装gevent时出现完整错误:
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>=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 > 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 "<string>", line 1, in <module>
File "/private/var/folders/t4/xp7tp60132xfvpcsglylyyjr0000gn/T/pycharm-packaging0.tmp/gevent/setup.py", line 317, in <module>
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 >>f, line
TypeError: unsupported operand type(s) for >>: '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 -> build/lib.macosx-10.6-intel-3.4/gevent
copying gevent/_ssl2.py -> build/lib.macosx-10.6-intel-3.4/gevent
copying gevent/_sslgte279.py -> build/lib.macosx-10.6-intel-3.4/gevent
copying gevent/_threading.py -> build/lib.macosx-10.6-intel-3.4/gevent
copying gevent/backdoor.py -> build/lib.macosx-10.6-intel-3.4/gevent
copying gevent/baseserver.py -> build/lib.macosx-10.6-intel-3.4/gevent
copying gevent/coros.py -> build/lib.macosx-10.6-intel-3.4/gevent
copying gevent/event.py -> build/lib.macosx-10.6-intel-3.4/gevent
copying gevent/fileobject.py -> build/lib.macosx-10.6-intel-3.4/gevent
copying gevent/greenlet.py -> build/lib.macosx-10.6-intel-3.4/gevent
copying gevent/hub.py -> build/lib.macosx-10.6-intel-3.4/gevent
copying gevent/local.py -> build/lib.macosx-10.6-intel-3.4/gevent
copying gevent/lock.py -> build/lib.macosx-10.6-intel-3.4/gevent
copying gevent/monkey.py -> build/lib.macosx-10.6-intel-3.4/gevent
copying gevent/os.py -> build/lib.macosx-10.6-intel-3.4/gevent
copying gevent/pool.py -> build/lib.macosx-10.6-intel-3.4/gevent
copying gevent/pywsgi.py -> build/lib.macosx-10.6-intel-3.4/gevent
copying gevent/queue.py -> build/lib.macosx-10.6-intel-3.4/gevent
copying gevent/resolver_ares.py -> build/lib.macosx-10.6-intel-3.4/gevent
copying gevent/resolver_thread.py -> build/lib.macosx-10.6-intel-3.4/gevent
copying gevent/select.py -> build/lib.macosx-10.6-intel-3.4/gevent
copying gevent/server.py -> build/lib.macosx-10.6-intel-3.4/gevent
copying gevent/socket.py -> build/lib.macosx-10.6-intel-3.4/gevent
copying gevent/ssl.py -> build/lib.macosx-10.6-intel-3.4/gevent
copying gevent/subprocess.py -> build/lib.macosx-10.6-intel-3.4/gevent
copying gevent/thread.py -> build/lib.macosx-10.6-intel-3.4/gevent
copying gevent/threading.py -> build/lib.macosx-10.6-intel-3.4/gevent
copying gevent/threadpool.py -> build/lib.macosx-10.6-intel-3.4/gevent
copying gevent/timeout.py -> build/lib.macosx-10.6-intel-3.4/gevent
copying gevent/util.py -> build/lib.macosx-10.6-intel-3.4/gevent
copying gevent/win32util.py -> build/lib.macosx-10.6-intel-3.4/gevent
copying gevent/wsgi.py -> 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 > 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 "<string>", line 1, in <module>
File "/private/var/folders/t4/xp7tp60132xfvpcsglylyyjr0000gn/T/pycharm-packaging0.tmp/gevent/setup.py", line 317, in <module>
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 >>f, line
TypeError: unsupported operand type(s) for >>: '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