gpt4 book ai didi

python - 无法使用 Python3 在 Ubuntu 上安装 selenium

转载 作者:塔克拉玛干 更新时间:2023-11-03 01:52:45 25 4
gpt4 key购买 nike

我想在带有 Python3 的 Ubuntu 上使用 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

最佳答案

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

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

关于python - 无法使用 Python3 在 Ubuntu 上安装 selenium,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19620890/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com