简体   繁体   English

无法使用Python3在Ubuntu上安装Selenium

[英]Failed to install selenium on Ubuntu with Python3

I want to use selenium on Ubuntu with Python3. 我想在带有Python3的Ubuntu上使用硒。 I run the following commands according to instructions: 我根据说明运行以下命令:

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...

But when I try to import selenium module in python3 I get an error: 但是,当我尝试在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

You can use selenium on Ubuntu with Python3 by following steps: 您可以通过以下步骤在具有Python3的Ubuntu上使用硒:

  1. use sudo apt-get install python3-pip to install pip for python3 使用sudo apt-get install python3-pip pip为python3安装pip
  2. use sudo python3 -m pip install -U selenium to install selenium for python3 使用sudo python3 -m pip install -U selenium selenium为python3安装硒

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM