环境信息: centos7操作系统,python3.8

执行pip3 install clickhouse_sqlalchemy或者pip3 install greenlet报以下报错:

Command "/opt/python3.6.10-customized/bin/python3.6 -u -c "import setuptools, tokenize;file='/tmp/pip-install-wbyi43ip/greenlet/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /tmp/pip-record-qh_gt5sg/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-wbyi43ip/greenlet/

解决办法:

pip版本太低了,本地是18.1执行 pip3 install --upgrade pip 更新到pip-20.x后重新安装就可以了

附完整报错

pip3 install clickhouse_sqlalchemy
Collecting clickhouse_sqlalchemy
  Using cached https://files.pythonhosted.org/packages/6e/e7/3cb53dfd35abe5f56d7e2db01cb8b883bd93bf15ec6e339a92fa56d4d8ec/clickhouse-sqlalchemy-0.2.3.tar.gz
Collecting sqlalchemy<1.5,>=1.4 (from clickhouse_sqlalchemy)
  Using cached https://files.pythonhosted.org/packages/c6/7f/af5bcd96ea6c3bb516975ae17a5c5852fa3ec9d2e993b7e75b3656926c1c/SQLAlchemy-1.4.49-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Requirement already satisfied: requests in /opt/python3.6.10-customized/lib/python3.6/site-packages (from clickhouse_sqlalchemy) (2.25.0)
Requirement already satisfied: clickhouse-driver>=0.1.2 in /opt/python3.6.10-customized/lib/python3.6/site-packages (from clickhouse_sqlalchemy) (0.2.5)
Collecting greenlet!=0.4.17; python_version >= "3" and (platform_machine == "aarch64" or (platform_machine == "ppc64le" or (platform_machine == "x86_64" or (platform_machine == "amd64" or (platform_machine == "AMD64" or (platform_machine == "win32" or platform_machine == "WIN32")))))) (from sqlalchemy<1.5,>=1.4->clickhouse_sqlalchemy)
  Using cached https://files.pythonhosted.org/packages/1e/1e/632e55a04d732c8184201238d911207682b119c35cecbb9a573a6c566731/greenlet-2.0.2.tar.gz
Requirement already satisfied: importlib-metadata; python_version < "3.8" in /opt/python3.6.10-customized/lib/python3.6/site-packages (from sqlalchemy<1.5,>=1.4->clickhouse_sqlalchemy) (4.8.3)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /opt/python3.6.10-customized/lib/python3.6/site-packages (from requests->clickhouse_sqlalchemy) (1.26.2)
Requirement already satisfied: idna<3,>=2.5 in /opt/python3.6.10-customized/lib/python3.6/site-packages (from requests->clickhouse_sqlalchemy) (2.10)
Requirement already satisfied: certifi>=2017.4.17 in /opt/python3.6.10-customized/lib/python3.6/site-packages (from requests->clickhouse_sqlalchemy) (2020.11.8)
Requirement already satisfied: chardet<4,>=3.0.2 in /opt/python3.6.10-customized/lib/python3.6/site-packages (from requests->clickhouse_sqlalchemy) (3.0.4)
Requirement already satisfied: pytz in /opt/python3.6.10-customized/lib/python3.6/site-packages (from clickhouse-driver>=0.1.2->clickhouse_sqlalchemy) (2023.3)
Requirement already satisfied: tzlocal in /opt/python3.6.10-customized/lib/python3.6/site-packages (from clickhouse-driver>=0.1.2->clickhouse_sqlalchemy) (4.2)
Requirement already satisfied: typing-extensions>=3.6.4; python_version < "3.8" in /opt/python3.6.10-customized/lib/python3.6/site-packages (from importlib-metadata; python_version < "3.8"->sqlalchemy<1.5,>=1.4->clickhouse_sqlalchemy) (4.1.1)
Requirement already satisfied: zipp>=0.5 in /opt/python3.6.10-customized/lib/python3.6/site-packages (from importlib-metadata; python_version < "3.8"->sqlalchemy<1.5,>=1.4->clickhouse_sqlalchemy) (3.6.0)
Requirement already satisfied: backports.zoneinfo; python_version < "3.9" in /opt/python3.6.10-customized/lib/python3.6/site-packages (from tzlocal->clickhouse-driver>=0.1.2->clickhouse_sqlalchemy) (0.2.1)
Requirement already satisfied: pytz-deprecation-shim in /opt/python3.6.10-customized/lib/python3.6/site-packages (from tzlocal->clickhouse-driver>=0.1.2->clickhouse_sqlalchemy) (0.1.0.post0)
Requirement already satisfied: importlib-resources; python_version < "3.7" in /opt/python3.6.10-customized/lib/python3.6/site-packages (from backports.zoneinfo; python_version < "3.9"->tzlocal->clickhouse-driver>=0.1.2->clickhouse_sqlalchemy) (5.4.0)
Requirement already satisfied: tzdata; python_version >= "3.6" in /opt/python3.6.10-customized/lib/python3.6/site-packages (from pytz-deprecation-shim->tzlocal->clickhouse-driver>=0.1.2->clickhouse_sqlalchemy) (2023.3)
Installing collected packages: greenlet, sqlalchemy, clickhouse-sqlalchemy
  Running setup.py install for greenlet ... error
    Complete output from command /opt/python3.6.10-customized/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-wbyi43ip/greenlet/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-qh_gt5sg/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.6
    creating build/lib.linux-x86_64-3.6/greenlet
    copying src/greenlet/__init__.py -> build/lib.linux-x86_64-3.6/greenlet
    creating build/lib.linux-x86_64-3.6/greenlet/platform
    copying src/greenlet/platform/__init__.py -> build/lib.linux-x86_64-3.6/greenlet/platform
    creating build/lib.linux-x86_64-3.6/greenlet/tests
    copying src/greenlet/tests/__init__.py -> build/lib.linux-x86_64-3.6/greenlet/tests
    copying src/greenlet/tests/leakcheck.py -> build/lib.linux-x86_64-3.6/greenlet/tests
    copying src/greenlet/tests/test_contextvars.py -> build/lib.linux-x86_64-3.6/greenlet/tests
    copying src/greenlet/tests/test_cpp.py -> build/lib.linux-x86_64-3.6/greenlet/tests
    copying src/greenlet/tests/test_extension_interface.py -> build/lib.linux-x86_64-3.6/greenlet/tests
    copying src/greenlet/tests/test_gc.py -> build/lib.linux-x86_64-3.6/greenlet/tests
    copying src/greenlet/tests/test_generator.py -> build/lib.linux-x86_64-3.6/greenlet/tests
    copying src/greenlet/tests/test_generator_nested.py -> build/lib.linux-x86_64-3.6/greenlet/tests
    copying src/greenlet/tests/test_greenlet.py -> build/lib.linux-x86_64-3.6/greenlet/tests
    copying src/greenlet/tests/test_greenlet_trash.py -> build/lib.linux-x86_64-3.6/greenlet/tests
    copying src/greenlet/tests/test_leaks.py -> build/lib.linux-x86_64-3.6/greenlet/tests
    copying src/greenlet/tests/test_stack_saved.py -> build/lib.linux-x86_64-3.6/greenlet/tests
    copying src/greenlet/tests/test_throw.py -> build/lib.linux-x86_64-3.6/greenlet/tests
    copying src/greenlet/tests/test_tracing.py -> build/lib.linux-x86_64-3.6/greenlet/tests
    copying src/greenlet/tests/test_version.py -> build/lib.linux-x86_64-3.6/greenlet/tests
    copying src/greenlet/tests/test_weakref.py -> build/lib.linux-x86_64-3.6/greenlet/tests
    running egg_info
    writing src/greenlet.egg-info/PKG-INFO
    writing dependency_links to src/greenlet.egg-info/dependency_links.txt
    writing requirements to src/greenlet.egg-info/requires.txt
    writing top-level names to src/greenlet.egg-info/top_level.txt
    reading manifest file 'src/greenlet.egg-info/SOURCES.txt'
    reading manifest template 'MANIFEST.in'
    warning: no previously-included files found matching 'benchmarks/*.json'
    no previously-included directories found matching 'docs/_build'
    warning: no files found matching '*.py' under directory 'appveyor'
    warning: no previously-included files matching '*.pyc' found anywhere in distribution
    warning: no previously-included files matching '*.pyd' found anywhere in distribution
    warning: no previously-included files matching '*.so' found anywhere in distribution
    warning: no previously-included files matching '.coverage' found anywhere in distribution
    writing manifest file 'src/greenlet.egg-info/SOURCES.txt'
    copying src/greenlet/greenlet.cpp -> build/lib.linux-x86_64-3.6/greenlet
    copying src/greenlet/greenlet.h -> build/lib.linux-x86_64-3.6/greenlet
    copying src/greenlet/greenlet_allocator.hpp -> build/lib.linux-x86_64-3.6/greenlet
    copying src/greenlet/greenlet_compiler_compat.hpp -> build/lib.linux-x86_64-3.6/greenlet
    copying src/greenlet/greenlet_cpython_compat.hpp -> build/lib.linux-x86_64-3.6/greenlet
    copying src/greenlet/greenlet_exceptions.hpp -> build/lib.linux-x86_64-3.6/greenlet
    copying src/greenlet/greenlet_greenlet.hpp -> build/lib.linux-x86_64-3.6/greenlet
    copying src/greenlet/greenlet_internal.hpp -> build/lib.linux-x86_64-3.6/greenlet
    copying src/greenlet/greenlet_refs.hpp -> build/lib.linux-x86_64-3.6/greenlet
    copying src/greenlet/greenlet_slp_switch.hpp -> build/lib.linux-x86_64-3.6/greenlet
    copying src/greenlet/greenlet_thread_state.hpp -> build/lib.linux-x86_64-3.6/greenlet
    copying src/greenlet/greenlet_thread_state_dict_cleanup.hpp -> build/lib.linux-x86_64-3.6/greenlet
    copying src/greenlet/greenlet_thread_support.hpp -> build/lib.linux-x86_64-3.6/greenlet
    copying src/greenlet/slp_platformselect.h -> build/lib.linux-x86_64-3.6/greenlet
    copying src/greenlet/platform/setup_switch_x64_masm.cmd -> build/lib.linux-x86_64-3.6/greenlet/platform
    copying src/greenlet/platform/switch_aarch64_gcc.h -> build/lib.linux-x86_64-3.6/greenlet/platform
    copying src/greenlet/platform/switch_alpha_unix.h -> build/lib.linux-x86_64-3.6/greenlet/platform
    copying src/greenlet/platform/switch_amd64_unix.h -> build/lib.linux-x86_64-3.6/greenlet/platform
    copying src/greenlet/platform/switch_arm32_gcc.h -> build/lib.linux-x86_64-3.6/greenlet/platform
    copying src/greenlet/platform/switch_arm32_ios.h -> build/lib.linux-x86_64-3.6/greenlet/platform
    copying src/greenlet/platform/switch_arm64_masm.asm -> build/lib.linux-x86_64-3.6/greenlet/platform
    copying src/greenlet/platform/switch_arm64_masm.obj -> build/lib.linux-x86_64-3.6/greenlet/platform
    copying src/greenlet/platform/switch_arm64_msvc.h -> build/lib.linux-x86_64-3.6/greenlet/platform
    copying src/greenlet/platform/switch_csky_gcc.h -> build/lib.linux-x86_64-3.6/greenlet/platform
    copying src/greenlet/platform/switch_m68k_gcc.h -> build/lib.linux-x86_64-3.6/greenlet/platform
    copying src/greenlet/platform/switch_mips_unix.h -> build/lib.linux-x86_64-3.6/greenlet/platform
    copying src/greenlet/platform/switch_ppc64_aix.h -> build/lib.linux-x86_64-3.6/greenlet/platform
    copying src/greenlet/platform/switch_ppc64_linux.h -> build/lib.linux-x86_64-3.6/greenlet/platform
    copying src/greenlet/platform/switch_ppc_aix.h -> build/lib.linux-x86_64-3.6/greenlet/platform
    copying src/greenlet/platform/switch_ppc_linux.h -> build/lib.linux-x86_64-3.6/greenlet/platform
    copying src/greenlet/platform/switch_ppc_macosx.h -> build/lib.linux-x86_64-3.6/greenlet/platform
    copying src/greenlet/platform/switch_ppc_unix.h -> build/lib.linux-x86_64-3.6/greenlet/platform
    copying src/greenlet/platform/switch_riscv_unix.h -> build/lib.linux-x86_64-3.6/greenlet/platform
    copying src/greenlet/platform/switch_s390_unix.h -> build/lib.linux-x86_64-3.6/greenlet/platform
    copying src/greenlet/platform/switch_sparc_sun_gcc.h -> build/lib.linux-x86_64-3.6/greenlet/platform
    copying src/greenlet/platform/switch_x32_unix.h -> build/lib.linux-x86_64-3.6/greenlet/platform
    copying src/greenlet/platform/switch_x64_masm.asm -> build/lib.linux-x86_64-3.6/greenlet/platform
    copying src/greenlet/platform/switch_x64_masm.obj -> build/lib.linux-x86_64-3.6/greenlet/platform
    copying src/greenlet/platform/switch_x64_msvc.h -> build/lib.linux-x86_64-3.6/greenlet/platform
    copying src/greenlet/platform/switch_x86_msvc.h -> build/lib.linux-x86_64-3.6/greenlet/platform
    copying src/greenlet/platform/switch_x86_unix.h -> build/lib.linux-x86_64-3.6/greenlet/platform
    copying src/greenlet/tests/_test_extension.c -> build/lib.linux-x86_64-3.6/greenlet/tests
    copying src/greenlet/tests/_test_extension_cpp.cpp -> build/lib.linux-x86_64-3.6/greenlet/tests
    running build_ext
    building 'greenlet._greenlet' extension
    creating build/temp.linux-x86_64-3.6
    creating build/temp.linux-x86_64-3.6/src
    creating build/temp.linux-x86_64-3.6/src/greenlet
    gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/opt/python3.6.10-customized/include/python3.6m -c src/greenlet/greenlet.cpp -o build/temp.linux-x86_64-3.6/src/greenlet/greenlet.o
    In file included from /usr/include/c++/4.8.2/cstdint:35:0,
                     from src/greenlet/greenlet_compiler_compat.hpp:63,
                     from src/greenlet/greenlet_internal.hpp:17,
                     from src/greenlet/greenlet.cpp:19:
    /usr/include/c++/4.8.2/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
     #error This file requires compiler and library support for the \
      ^
    In file included from src/greenlet/greenlet_greenlet.hpp:11:0,
                     from src/greenlet/greenlet_internal.hpp:20,
                     from src/greenlet/greenlet.cpp:19:
    src/greenlet/greenlet_refs.hpp:166:9: warning: identifier ‘nullptr’ is a keyword in C++11 [-Wc++0x-compat]
             explicit PyObjectPointer(T* it=nullptr) : p(it)
             ^
    src/greenlet/greenlet_refs.hpp:181:9: warning: identifier ‘noexcept’ is a keyword in C++11 [-Wc++0x-compat]
             inline T* borrow() const G_NOEXCEPT
             ^
    src/greenlet/greenlet_refs.hpp:181:28: error: expected ‘;’ at end of member declaration
             inline T* borrow() const G_NOEXCEPT
                                ^
    In file included from src/greenlet/greenlet_internal.hpp:17:0,
                     from src/greenlet/greenlet.cpp:19:
    src/greenlet/greenlet_compiler_compat.hpp:66:20: error: ‘noexcept’ does not name a type
     #define G_NOEXCEPT noexcept
                        ^
    src/greenlet/greenlet_refs.hpp:181:34: note: in expansion of macro ‘G_NOEXCEPT’
             inline T* borrow() const G_NOEXCEPT
                                      ^
    In file included from src/greenlet/greenlet_greenlet.hpp:11:0,
                     from src/greenlet/greenlet_internal.hpp:20,
                     from src/greenlet/greenlet.cpp:19:
    src/greenlet/greenlet_refs.hpp:186:30: error: expected ‘;’ at end of member declaration
             PyObject* borrow_o() const G_NOEXCEPT
                                  ^
    In file included from src/greenlet/greenlet_internal.hpp:17:0,
                     from src/greenlet/greenlet.cpp:19:
    src/greenlet/greenlet_compiler_compat.hpp:66:20: error: ‘noexcept’ does not name a type
     #define G_NOEXCEPT noexcept
                        ^
    src/greenlet/greenlet_refs.hpp:186:36: note: in expansion of macro ‘G_NOEXCEPT’
             PyObject* borrow_o() const G_NOEXCEPT
                                        ^
    In file included from src/greenlet/greenlet_greenlet.hpp:11:0,
                     from src/greenlet/greenlet_internal.hpp:20,
                     from src/greenlet/greenlet.cpp:19:
    src/greenlet/greenlet_refs.hpp:191:32: error: expected ‘;’ at end of member declaration
             inline T* operator->() const G_NOEXCEPT
                                    ^
    In file included from src/greenlet/greenlet_internal.hpp:17:0,
                     from src/greenlet/greenlet.cpp:19:
    src/greenlet/greenlet_compiler_compat.hpp:66:20: error: ‘noexcept’ does not name a type
     #define G_NOEXCEPT noexcept
                        ^
    src/greenlet/greenlet_refs.hpp:191:38: note: in expansion of macro ‘G_NOEXCEPT’
             inline T* operator->() const G_NOEXCEPT
                                          ^
    In file included from src/greenlet/greenlet_greenlet.hpp:11:0,
                     from src/greenlet/greenlet_internal.hpp:20,
                     from src/greenlet/greenlet.cpp:19:
    src/greenlet/greenlet_refs.hpp:196:24: error: expected ‘;’ at end of member declaration
             bool is_None() const G_NOEXCEPT
                            ^
    In file included from src/greenlet/greenlet_internal.hpp:17:0,
                     from src/greenlet/greenlet.cpp:19:
    src/greenlet/greenlet_compiler_compat.hpp:66:20: error: ‘noexcept’ does not name a type
     #define G_NOEXCEPT noexcept
                        ^
    src/greenlet/greenlet_refs.hpp:196:30: note: in expansion of macro ‘G_NOEXCEPT’
             bool is_None() const G_NOEXCEPT
                                  ^
    In file included from src/greenlet/greenlet_greenlet.hpp:11:0,
                     from src/greenlet/greenlet_internal.hpp:20,
                     from src/greenlet/greenlet.cpp:19:
    src/greenlet/greenlet_refs.hpp:201:44: error: expected ‘;’ at end of member declaration
             inline PyObject* acquire_or_None() const G_NOEXCEPT