解压:
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
标签:Python,make,编译,prefix,install,Linux,pip,--
From: https://www.cnblogs.com/stdpain/p/18219852