2011-12-23 17 views
2

我在CentOS 5.5 x86_64机器上安装了python 2.7。在使用Selenium Web驱动程序时,Python调用32位X11 lib文件而不是64位

$ 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.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位库?

+0

Sign is removed,please refer the FAQ – 2011-12-23 13:56:53

回答

2

我对科学版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.

更改链接并没有为我工作,但我没有尝试修补硒。希望这将在下一个版本中得到解决。

+0

我有同样的问题..你有没有找到解决方案? – 2012-02-20 23:30:29

+1

好的我通过更改路径解决了问题: sudo rm /usr/lib/libX11.so.6 sudo ln -s /usr/lib64/libX11.so.6.2.0 /usr/lib/libX11.so。 6 所以用firefox64bit效果不错 – 2012-02-21 12:39:00

+0

据我记得我也试过这个,但后来X11拒绝启动。 – Michael 2012-02-23 14:07:35

0

我有可能同样的问题,我固定它虽然丑:

我的错误:

文件“/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:扩展名“RANDR”缺失显示“:1023.0”。\ n无法使用dlopen /usr/lib/libX11.so.6\ndlerror说:/usr/lib/libX11.so.6:错误的ELF类:ELFCLASS32 \ n”

我的环境:
Fedora 14的X64
火狐:3.6.24 X64
硒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/
(请注意,您可能要备份,以防原始文件也不会为你工作)

相关问题