在centos执行playwright install时,报错
/home/PlaywrightAllure/venv/lib/python3.7/site-packages/playwright/driver/node: /lib64/libm.so.6: version `GLIBC_2.27' not found (required by /home/PlaywrightAllure/venv/lib/python3.7/site-packages/playwright/driver/node)
/home/PlaywrightAllure/venv/lib/python3.7/site-packages/playwright/driver/node: /lib64/libc.so.6: version `GLIBC_2.25' not found (required by /home/PlaywrightAllure/venv/lib/python3.7/site-packages/playwright/driver/node)
/home/PlaywrightAllure/venv/lib/python3.7/site-packages/playwright/driver/node: /lib64/libc.so.6: version `GLIBC_2.28' not found (required by /home/PlaywrightAllure/venv/lib/python3.7/site-packages/playwright/driver/node)
/home/PlaywrightAllure/venv/lib/python3.7/site-packages/playwright/driver/node: /lib64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by /home/PlaywrightAllure/venv/lib/python3.7/site-packages/playwright/driver/node)
/home/PlaywrightAllure/venv/lib/python3.7/site-packages/playwright/driver/node: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /home/PlaywrightAllure/venv/lib/python3.7/site-packages/playwright/driver/node)
/home/PlaywrightAllure/venv/lib/python3.7/site-packages/playwright/driver/node: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /home/PlaywrightAllure/venv/lib/python3.7/site-packages/playwright/driver/node)
折腾了好半天。
解决方案,降低版本,之前是1.31.1
pip install playwright==1.16.1 -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com
pip install pytest-playwright==0.2.2 -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com
使用上述方案,的确可以安装成功,但是本质问题还是没有解决
# 解决: 升级gcc与make
# 1. 安装GCC-8
yum install -y devtoolset-8-gcc devtoolset-8-gcc-c++ devtoolset-8-binutils
# 设置环境变量
echo "source /opt/rh/devtoolset-8/enable" >> /etc/profile
source /etc/profile
# 2. 升级 make
wget https://ftp.gnu.org/gnu/make/make-4.3.tar.gz
tar -xzvf make-4.3.tar.gz && cd make-4.3/
# 安装到指定目录
./configure --prefix=/usr/local/make
make && make install
# 创建软链接
cd /usr/bin/ && mv make make.bak
ln -sv /usr/local/make/bin/make /usr/bin/make
# 继续编译 glibc -- 进入刚才安装`glibc-2.28/build`的目录
cd /root/glibc-2.28/build
../configure --prefix=/usr --disable-profile --enable-add-ons --with-headers=/usr/include --with-binutils=/usr/bin
# ***********************************************************************
make && make install
# 日志最后会出现如下问题
# primary library!
# make[1]: *** [Makefile:111: install] Error 1
# make[1]: Leaving directory '/root/glibc-2.28'
# make: *** [Makefile:12: install] Error 2
# 再次查看系统内安装的glibc版本
strings /lib64/libc.so.6 |grep GLIBC_
# 测试
node -v
npm -v
有个其他报错 不记得了
我执行了
yum install -y libgtk*
这个是网络上其他情况,我没有使用,收纳一下文章来源:https://www.toymoban.com/news/detail-425926.html
然后会报错如下:
# [root@master build]# node -v
# node: /lib64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by node)
# node: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by node)
# node: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by node)
# 解决
yum install libstdc++.so.6 -y
# 查看动态链接库 -- 发现并没有需要的1.3.9
strings /usr/lib/libstdc++.so.6 | grep 'CXXABI'
# 下载需要的版本库,之后软连接到运行系统上
wget http://ftp.de.debian.org/debian/pool/main/g/gcc-8/libstdc++6_8.3.0-6_amd64.deb
ar -x libstdc++6_8.3.0-6_amd64.deb
tar -xvf data.tar.xz
cp usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.25 /usr/lib64/
find / -name "libstdc++*"
# 删除低版本库的软连接
rm -rf /usr/lib64/libstdc++.so.6
ll /usr/lib64/libstd*
ln -s /usr/lib64/libstdc++.so.6.0.25 /usr/lib64/libstdc++.so.6
# 检验
node -v
npm -v
/lib64/libc.so.6: version `GLIBC_2.18' not found文章来源地址https://www.toymoban.com/news/detail-425926.html
curl -O http://ftp.gnu.org/gnu/glibc/glibc-2.18.tar.gz
tar zxf glibc-2.18.tar.gz
cd glibc-2.18/
mkdir build
cd build/
../configure --prefix=/usr
make -j2
make install
到了这里,关于【playwright】centos系统安装提示version `GLIBC_2.27‘ not found的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!