更新安装源
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
sed -i 's/$releasever/7/g' /etc/yum.repos.d/CentOS-Base.repo
yum repolist
安装依赖包
yum -y groupinstall "Development tools"
yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel
更换openssl
python3一般需要高版本的openssl,所以得替换高版本openssl
# 1.下载openssl:https://www.openssl.org/source/
wget https://www.openssl.org/source/openssl-1.1.1w.tar.gz
tar -zxvf openssl-1.1.1w.tar.gz
cd openssl-1.1.1w
# 2.编译安装
./config --prefix=/usr/local/openssl
make
make install
# 3.备份原配置
mv /usr/bin/openssl /usr/bin/openssl.bak
mv /usr/include/openssl/ /usr/include/openssl.bak
# 4.新版配置
ln -s /usr/local/openssl/include/openssl /usr/include/openssl
ln -s /usr/local/openssl/lib/libssl.so.1.1 /usr/local/lib64/libssl.so
ln -s /usr/local/openssl/bin/openssl /usr/bin/openssl
# 5.修改系统配置
## 写入openssl库文件的搜索路径
echo "/usr/local/openssl/lib" >> /etc/ld.so.conf
## 使修改后的/etc/ld.so.conf生效
ldconfig -v
# 6.查看openssl版本
openssl version
参考:https://blog.csdn.net/lkgCSDN/article/details/84403329
安装python3.10
wget https://www.python.org/ftp/python/3.10.10/Python-3.10.10.tar.xz
tar -xvJf Python-3.10.10.tar.xz
cd Python-3.10.10
./configure --with-openssl=/usr/local/openssl
# 或./configure --prefix=/usr/local/python3 --with-openssl=/usr/local/openssl
make && make install
python3 --version
安装依赖
pip3 install Cython
yum install -y xxhash
yum install -y xxhash-devel
yum install -y libXfixes-devel
yum install -y libXext-devel
yum install -y libXdamage-devel
yum install -y libxkbfile-devel
yum install -y libXrandr-devel
yum install -y libXtst-devel
yum install -y libXcomposite-devel
yum install -y libXres-devel
yum install -y gtk3-devel
yum install -y cairo-devel
yum install -y pygobject3-devel
yum install -y lz4-devel
yum install -y pycairo-devel
重点
py3cairo
修改setup.py py3cairo 修改为 cairo
tace(client_ENABLED and gtk3_ENABLED, "xpra.client.gtk3.cairo_workaround", "py3cairo",
yum install -y cairo-devel
安装xpra
git clone https://github.com/Xpra-org/xpra
cd xpra
python3 ./setup.py install
FAQ
1、找不到Cython模块
解决:pip3 install Cython
2、找不到py3cairo
修改setup.py py3cairo 修改为 cairo
安装 yum install -y pycairo-devel
修改编译pycairo头文件
vim setup.py
# tace(client_ENABLED and gtk3_ENABLED, "xpra.client.gtk3.cairo_workaround", "cairo",
yum install -y pycairo-devel
cp /usr/local/lib64/python3.6/site-packages/pycairo-1.25.0-py3.6-linux-x86_64.egg/cairo/include/py3cairo.h /usr/include/cairo
3、error: [Errno 2] No such file or directory: 'pandoc'
下载:https://github.com/jgm/pandoc/releases/tag/3.1.8
解压:tar zxvf pandoc-3.1.8-linux-amd64.tar.gz
拷贝:cd pandoc-3.1.8 && cp bin/pandoc /usr/bin
wget https://github.com/jgm/pandoc/releases/tag/3.1.8
tar zxvf pandoc-3.1.8-linux-amd64.tar.gz
cd pandoc-3.1.8
cp bin/pandoc /usr/bin
网友评论