centos中安装clickhouse-driver时,出现错误error: command 'gcc' failed with exit status 1
时间: 2023-09-25 08:13:11 浏览: 289
这个错误提示表明安装 `clickhouse-driver` 时缺少了 `gcc` 编译器。你需要安装 `gcc` 编译器以解决这个问题。
你可以使用以下命令来安装 `gcc` 编译器:
```
sudo yum install gcc
```
安装完成后,再次尝试安装 `clickhouse-driver` 库,应该就可以正常安装了。
另外,如果你在使用虚拟环境,请确保激活虚拟环境后再安装 `clickhouse-driver` 库,以免出现路径不一致的问题。
相关问题
linux 安装clickhouse_driver出现错误:gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/include/python3.6m -c clickhouse_driver/bufferedreader.c -o build/temp.linux-x86_64-3.6/clickhouse_driver/bufferedreader.o clickhouse_driver/bufferedreader.c:19:20: fatal error: Python.h: No such file or directory #include "Python.h" ^ compilation terminated. error: command 'gcc' failed with exit status 1 ---------------------------------------- Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-w5x91rjz/clickhouse-driver/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-xmhi2dby-record/install-record.txt --single-version-externally-managed --compile --home=/tmp/tmpbb1re1j5" failed with error code 1 in /tmp/pip-build-w5x91rjz/clickhouse-driver/
这个错误提示是由于缺少Python开发包导致的。您可以使用以下命令来安装Python开发包:
- 对于Debian/Ubuntu系统:
```
sudo apt-get install python-dev
```
- 对于CentOS/RHEL系统:
```
sudo yum install python-devel
```
安装完成后,再重新运行clickhouse_driver的安装命令即可。
阅读全文
相关推荐















