我已经在CentOS 5.5 x86_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驱动程序运行一个基本的登录脚本&它失败了,错误如下。
selenium.common.exceptions.WebDriverException: Message: 'The browser appears to have exited before we could connect. The output was: Failed to dlopen /usr/lib/libX11.so.6\ndlerror says: /usr/lib/libX11.so.6: wrong ELF class: ELFCLASS32\n'为什么它使用32位X11库而不是64位X11库?如何让python使用64位库?
发布于 2012-01-13 19:42:41
我在Scientific Linux6上遇到了同样的错误,并尝试按照下面的描述更改库:http://code.google.com/p/selenium/issues/detail?id=2852
Firefox64bit+ x_ignore_nofocus失败的原因是:在64位模式下,正如我们所看到的,库x_ignore_nofocus在" /usr/lib/libX11.so.6“的方式中查找libX11.so.6,但是这个符号链接/usr/lib/libX11.so.6引用了/usr/lib/libX11.so.6.2.0,这是一个32位的库。
更改链接对我不起作用,但我没有尝试修补selenium。希望这个问题能在下一个版本中得到解决。
发布于 2012-03-19 04:12:55
我可能也有同样的问题,我解决了它,尽管很难看:
我的错误:
File "/usr/lib/python2.7/site-packages/selenium/webdriver/firefox/firefox_binary.py",第81行,在_wait_until_connectable self._get_firefox_output()) selenium.common.exceptions.WebDriverException:消息中:‘在我们可以连接之前,浏览器似乎已经退出。输出为: Xlib: extension "RANDR“display ":1023.0".\nFailed to dlopen /usr/lib/libX11.so.6\n错误提示: /usr/lib/libX11.so.6:错误的ELF类: ELFCLASS32\n‘
我的环境:
Fedora 14 X64
火狐: 3.6.24 X64
Selenium 2.20.0 (webdriver)
我的丑陋但简单有效的解决方法:
我确实复制了文件:
/usr/lib/python2.7/site-packages/selenium/webdriver/firefox/x86/x_ignore_nofocus.so
进入:
/usr/lib/python2.7/site-packages/selenium/webdriver/firefox/amd64/
(请注意,您可能希望备份原始文件,以防它不适用于您)
https://stackoverflow.com/questions/8613787
复制相似问题