Selenium安装在python中,但仍然不能导入模块?

2024-09-27 21:31:40 发布

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

我用的是linuxmint。我用pip安装了selenium,它完成时没有任何问题。然后我运行python并尝试检查selenium是否有效:

ethomas@ethomas-linux ~ $ python
Python 2.7.9 (default, May 19 2015, 13:47:37) 
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import selenium
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named selenium

然后在python中我做到了:

^{pr2}$

我运行$locate selenium,它都在/usr/local/lib/python2.7/dist-packages/selenium中找到。但是我仍然不能在python中导入selenium。有人知道问题出在哪里吗?这可能和系统路径但我不确定。在


Tags: pipdefaultonlinuxtypeseleniumhelpmay
1条回答
网友
1楼 · 发布于 2024-09-27 21:31:40

我已经安装了Python2.7.9,而我的机器上的默认值是2.7.6,所以它把它放到usr/local/bin中,导致了错误。从usr/local/bin删除它修复了这个问题。在

相关问题 更多 >

    热门问题