安装snowflake-connector-python遇cmake相关错误求助
安装snowflake-connector-python时遇到pyarrow编译错误
环境信息
- Python版本:3.11.1
- pip版本:22.3.1
初始错误:cmake命令不存在
尝试用pip安装snowflake-connector-python时,触发pyarrow编译,报错cmake找不到:
copying pyarrow/tests/parquet/test_metadata.py -> build/lib.macosx-10.9-universal2-cpython-311/pyarrow/tests/parquet copying pyarrow/tests/parquet/test_pandas.py -> build/lib.macosx-10.9-universal2-cpython-311/pyarrow/tests/parquet copying pyarrow/tests/parquet/test_parquet_file.py -> build/lib.macosx-10.9-universal2-cpython-311/pyarrow/tests/parquet copying pyarrow/tests/parquet/test_parquet_writer.py -> build/lib.macosx-10.9-universal2-cpython-311/pyarrow/tests/parquet running build_ext creating /private/var/folders/4c/xj1m5wts0xx46bbh5qhhhg4m0000gq/T/pip-install-v4ysgr2_/pyarrow_ae70c3da10594e6eb24b27149ad7d95d/build/temp.macosx-10.9-universal2-cpython-311 -- Running cmake for pyarrow cmake -DPYTHON_EXECUTABLE=/Users/gree030/Workspace/projectName/venv/bin/python -DPython3_EXECUTABLE=/Users/gree030/Workspace/projectName/venv/bin/python "" -DPYARROW_BUILD_CUDA=off -DPYARROW_BUILD_FLIGHT=off -DPYARROW_BUILD_GANDIVA=off -DPYARROW_BUILD_DATASET=off -DPYARROW_BUILD_ORC=off -DPYARROW_BUILD_PARQUET=off -DPYARROW_BUILD_PARQUET_ENCRYPTION=off -DPYARROW_BUILD_PLASMA=off -DPYARROW_BUILD_S3=off -DPYARROW_BUILD_HDFS=off -DPYARROW_USE_TENSORFLOW=off -DPYARROW_BUNDLE_ARROW_CPP=off -DPYARROW_BUNDLE_BOOST=off -DPYARROW_GENERATE_COVERAGE=off -DPYARROW_BOOST_USE_SHARED=on -DPYARROW_PARQUET_USE_SHARED=on -DCMAKE_BUILD_TYPE=release /private/var/folders/4c/xj1m5wts0xx46bbh5qhhhg4m0000gq/T/pip-install-v4ysgr2_/pyarrow_ae70c3da10594e6eb24b27149ad7d95d error: command 'cmake' failed: No such file or directory [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for pyarrow Failed to build pyarrow ERROR: Could not build wheels for pyarrow, which is required to install pyproject.toml-based projects [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. error: subprocess-exited-with-error × pip subprocess to install build dependencies did not run successfully. │ exit code: 1 ╰─> See above for output. note: This error originates from a subprocess, and is likely not a problem with pip.
安装cmake后出现新错误
安装并更新cmake后,编译pyarrow时出现模块找不到错误:
copying pyarrow/tests/parquet/test_pandas.py -> build/lib.macosx-10.9-universal2-cpython-311/pyarrow/tests/parquet copying pyarrow/tests/parquet/test_parquet_file.py -> build/lib.macosx-10.9-universal2-cpython-311/pyarrow/tests/parquet copying pyarrow/tests/parquet/test_parquet_writer.py -> build/lib.macosx-10.9-universal2-cpython-311/pyarrow/tests/parquet running build_ext creating /private/var/folders/4c/xj1m5wts0xx46bbh5qhhhg4m0000gq/T/pip-install-ejkkok_0/pyarrow_e560da15c45d4feeb95b2060af382048/build/temp.macosx-10.9-universal2-cpython-311 -- Running cmake for pyarrow cmake -DPYTHON_EXECUTABLE=/Users/gree030/Workspace/projectName/venv/bin/python -DPython3_EXECUTABLE=/Users/gree030/Workspace/projectName/venv/bin/python "" -DPYARROW_BUILD_CUDA=off -DPYARROW_BUILD_FLIGHT=off -DPYARROW_BUILD_GANDIVA=off -DPYARROW_BUILD_DATASET=off -DPYARROW_BUILD_ORC=off -DPYARROW_BUILD_PARQUET=off -DPYARROW_BUILD_PARQUET_ENCRYPTION=off -DPYARROW_BUILD_PLASMA=off -DPYARROW_BUILD_S3=off -DPYARROW_BUILD_HDFS=off -DPYARROW_USE_TENSORFLOW=off -DPYARROW_BUNDLE_ARROW_CPP=off -DPYARROW_BUNDLE_BOOST=off -DPYARROW_GENERATE_COVERAGE=off -DPYARROW_BOOST_USE_SHARED=on -DPYARROW_PARQUET_USE_SHARED=on -DCMAKE_BUILD_TYPE=release /private/var/folders/4c/xj1m5wts0xx46bbh5qhhhg4m0000gq/T/pip-install-ejkkok_0/pyarrow_e560da15c45d4feeb95b2060af382048 Traceback (most recent call last): File "/Users/gree030/Workspace/projectName/venv/bin/cmake", line 5, in <module> from cmake import cmake ModuleNotFoundError: No module named 'cmake' error: command '/Users/gree030/Workspace/projectName/venv/bin/cmake' failed with exit code 1 [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for pyarrow Failed to build pyarrow ERROR: Could not build wheels for pyarrow, which is required to install pyproject.toml-based projects [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. error: subprocess-exited-with-error × pip subprocess to install build dependencies did not run successfully. │ exit code: 1 ╰─> See above for output. note: This error originates from a subprocess, and is likely not a problem with pip.
已尝试的解决方法
- 遵循Snowflake官方文档,执行命令安装指定版本依赖:
pip install -r https://raw.githubusercontent.com/snowflakedb/snowflake-connector-python/main/tested_requirements/requirements_311.reqs
但问题仍未解决。
内容的提问来源于stack exchange,提问作者Khalil
相关产品推荐
相关产品推荐

