尝试在共享服务器上使用Selenium,以及Chrome和Firefox浏览器时,我遇到了一个错误。作为第一步 在我的用户家中下载这两种浏览器的二进制文件和驱动程序(分别是chromedriver和geckodriver)
在webdriver选项中设置二进制_位置和可执行_路径可以正确查找所有内容,但仍然会出现错误
在服务器上手动执行时,例如chromedriver,我得到:
/lib64/libc.so.6: version `GLIBC_2.14 'not found (required by ./chromedriver)
/lib64/libc.so.6: version `GLIBC_2.16 'not found (required by ./chromedriver)
对于firefox:
/lib64/libc.so.6: version `GLIBC_2.17 'not found (required by firefox)
/lib64/libc.so.6: version `GLIBC_2.14 'not found (required by firefox)
因此,我尝试安装GLIBC_2.17,通过以下帖子来解决问题:glibc error和install it as non root
代码如下:
# path new library
mkdir /home/db/glibc217
# path original files
mkdir /home/db/glibc217/download
# path install
mkdir /home/db/glibc217/install
# get files
cd /home/db/glibc217/download
wget http://ftp.gnu.org/gnu/glibc/glibc-2.17.tar.gz
# unzip => create /home/db/glibc217/glibc-2.17
tar zxvf /home/db/glibc217/download/glibc-2.17.tar.gz -C /home/db/glibc217/
# build
cd /home/db/glibc217/glibc-2.17
mkdir build
cd build
../configure --prefix=/home/db/glibc217/install
make -j4
make install
完成后,给出以下消息:
/home/db/glibc217/glibc-2.17/build/elf/ldconfig: Warning: ignoring configuration file that cannot be opened: /home/db/glibc217/install/etc/ld.so.conf: No such file or directory
此外,环境还有以下变量:
LD_LIBRARY_PATH=/home/db/glibc217/install/lib
安装版本2.17后,当执行python脚本时,对于Chrome库的缺失版本(它要求2.14和2.16)以及两种浏览器,会给出相同的消息:
/home/db/virtualenv/py_test/3.7/bin/python3.7_bin: error while loading shared libraries: __vdso_time: invalid mode for dlopen (): Invalid argument
安装过程中是否缺少一个步骤?是否可以采取措施避免安装的最终警告?对于所有必需的库版本,是否应执行相同的步骤?有没有办法修复最后的python错误? 非常感谢您的评论
This answer解释了设置
LD_LIBRARY_PATH
不起作用的原因,以及如何取而代之上面的错误非常清楚地表明
ld-linux
和libc.so.6
之间不匹配(其他迹象是彻底崩溃)相关问题 更多 >
编程相关推荐