Python在使用Selenium webdri时调用32位X11 lib文件而不是64位

2024-04-23 17:56:52 发布

您现在位置:Python中文网/ 问答频道 /正文

我已经在centos5.5x86_64机器上安装了python2.7。在

$ file /opt/python2.7.1/bin/python

/opt/python2.7.1/bin/python: ELF 64-bit LSB executable, AMD x86-64, version 1 (SYSV), for GNU/Linux 2.6.9, dynamically linked (uses shared libs), for GNU/Linux 2.6.9, not stripped

然后,我绑定使用selenium web驱动程序运行一个基本登录脚本,它失败,并出现以下错误。在

^{pr2}$

为什么它使用32位X11库而不是使用64位X11库?如何让python使用64位库?在


Tags: gnu机器forbinversionlinuxbitx86
2条回答

我在Scientific Linux 6上也遇到了相同的错误,并尝试按如下所述更改库: http://code.google.com/p/selenium/issues/detail?id=2852

Firefox 64bit + x_ignore_nofocus fails because: In 64 bit mode, as we have see, the library x_ignore_nofocus is looking for libX11.so.6 on the way "/usr/lib/libX11.so.6" But this symlink /usr/lib/libX11.so.6 is reference to /usr/lib/libX11.so.6.2.0, which is 32bit library.

更改链接对我来说不起作用,但我没有尝试修补selenium。希望在下一个版本中可以修复这个问题。在

我可能也遇到了同样的问题,尽管很难看,我还是解决了:

我的错误:

文件“/usr/lib/python2.7/site-packages/selenium/webdriver/firefox/firefox_二进制.py“,第81行,在uuu可连接 self.\u get_firefox_output()) selenium.common.异常.WebDriverException:消息:“在连接之前,浏览器似乎已退出。”。输出是:Xlib:extension“RANDR”在显示时丢失“:1023.0”。\n dlopen/usr/lib/libX11.so.6\ndlerror显示:/usr/lib/libX11.so.6:错误的ELF类:ELFCLASS32\n'

我的环境:
软呢绒14 X64
Firefox:3.6.24 X64
Selenium 2.20.0(网络驱动程序)

我的难看和工作:
我确实复制了文件:
/usr/lib/python2.7/site-packages/selenium/webdriver/firefox/x86/x_忽略_没有焦点。所以
进入:
/usr/lib/python2.7/site packages/selenium/webdriver/firefox/amd64/
(请注意,您可能需要备份原始文件,以防它对您无效)

相关问题 更多 >