解壓:
tar -zxf PythonXX.tgz
安裝依賴:
yum install libffi-devel
configure
mkdir build
cd build
../configure --enable-optimizations --prefix=`pwd`/install --with-openssl=$OPEN_SSL_INSTALL_DIR
Build:
make -j 48
make install
然後可以把install打包.
注意,install之後pip裡面的value是指向絕對路徑的。如果直接用pip install 他會裝到之前 prefix/install 的路徑的
所以一般的建議用pip之前是修改PYTHONPATH https://docs.python.org/3/using/cmdline.html#environment-variables
export PYTHONPATH=/root/python38
./bin/python3 ./bin/pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple grpcio