Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
无法在使用Python3的Ubuntu上安装selenium_Python_Linux_Ubuntu_Selenium - Fatal编程技术网

无法在使用Python3的Ubuntu上安装selenium

无法在使用Python3的Ubuntu上安装selenium,python,linux,ubuntu,selenium,Python,Linux,Ubuntu,Selenium,我想在Ubuntu和Python3上使用selenium。我根据说明运行以下命令: ubuntu:~$ sudo pip-3.2 install -U selenium Downloading/unpacking selenium Downloading selenium-2.37.2.tar.gz (2.6MB): 2.6MB downloaded Running setup.py egg_info for package selenium Installing collected

我想在Ubuntu和Python3上使用selenium。我根据说明运行以下命令:

ubuntu:~$ sudo pip-3.2 install -U selenium
Downloading/unpacking selenium
  Downloading selenium-2.37.2.tar.gz (2.6MB): 2.6MB downloaded
  Running setup.py egg_info for package selenium

Installing collected packages: selenium
  Running setup.py install for selenium

Successfully installed selenium
Cleaning up...
但是,当我尝试在python3中导入selenium模块时,出现了一个错误:

@ubuntu:~$ python3

    Python 3.2.5 (default, Sep  7 2013, 16:55:10) 
    [GCC 4.6.3] 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
@ubuntu:~$python3
Python 3.2.5(默认,2013年9月7日,16:55:10)
[GCC 4.6.3]关于linux2
有关详细信息,请键入“帮助”、“版权”、“信用证”或“许可证”。
>>>进口硒
回溯(最近一次呼叫最后一次):
文件“”,第1行,在
ImportError:没有名为selenium的模块

您可以通过以下步骤在Ubuntu和Python3上使用selenium:

  • 使用
    sudo apt get install python3 pip
    为python3安装pip
  • 使用
    sudo python3-m pip安装-U selenium
    为python3安装selenium

  • 您可以通过以下步骤在Ubuntu和Python3上使用selenium:

  • 使用
    sudo apt get install python3 pip
    为python3安装pip
  • 使用
    sudo python3-m pip安装-U selenium
    为python3安装selenium

  • 你重新启动了终端吗?它会用python 2.7运行吗?在我的例子中,它能用python工作(python 3也不工作)吗?你重新启动了终端吗?它会用python 2.7运行吗?在我的例子中,它能用python工作(python 3也不工作)