源码编译protobuf的python模块

1 说明

由于在 conda 中需要使用到 protobuf 模块,并且处于断网状态,不能通过 conda 或 pip 命令安装,最后选择了源码编译。

环境:Linux,x86x64,conda3,python3.6.4,gcc-4.8.5

2 下载 protobuf 源码

源码点击这里

进入后下载 protobuf-python-3.12.4.tar.gz

3 编译

tar -xvf protobuf-python-3.12.4.tar.gz
cd protobuf-python-3.12.4
./configure --prefix=/home/tanrui/protobuf
make -j8
make install

cd python
python setup.py build
python setup.py test
python setup.py install

安装完成后,用 conda list 命令查看是否能找到。

猜你喜欢

转载自blog.csdn.net/qq_33236581/article/details/113848789
今日推荐