首先可以确定,playwright在centos上部署官方是不支持的,github上可以看到
https://github.com/microsoft/playwright/issues/9194
走过很多坑,总结了下面一套部署方案:
一、首先安装比较低的版本
# 安装playwright pip install playwright==1.16.1 -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com # 安装pytest-playwright pip install pytest-playwright==0.2.2 -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com # 安装playwright的浏览器驱动 playwright install
二、接着会碰到version `GLIBC_2.18’ not found的问题,参考https://deno.js.cn/t/topic/611解决
1.下载解压
wget https://ftp.gnu.org/gnu/glibc/glibc-2.18.tar.gz tar -zxvf glibc-2.18.tar.gz
2.编译安装
cd glibc-2.18 && mkdir build cd build ../configure --prefix=/usr --disable-profile --enable-add-ons --with-headers=/usr/include --with-binutils=/usr/bin make && make install
3.验证
[root@VM_0_7_centos build]# ll /lib64/libc.so.6 lrwxrwxrwx 1 root root 12 Mar 25 09:01 /lib64/libc.so.6 -> libc-2.18.so
到这里基本部署完成,还有其他问题的话,仔细看报错信息,多查资料,细心一点有些问题自己可以解决的,相信自己。
标签:douban,playwright,部署,pypi,centos7,--,2.18,com From: https://www.cnblogs.com/soymilk2019/p/17412596.html