簡體   English   中英

無法使用Python3在Ubuntu上安裝Selenium

[英]Failed to install selenium on Ubuntu with Python3

我想在帶有Python3的Ubuntu上使用硒。 我根據說明運行以下命令:

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

您可以通過以下步驟在具有Python3的Ubuntu上使用硒:

  1. 使用sudo apt-get install python3-pip pip為python3安裝pip
  2. 使用sudo python3 -m pip install -U selenium selenium為python3安裝硒

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM