gpt4 book ai didi

python - Selenium "No module named ' selenium'“即使在 pip3 安装之后

转载 作者:太空宇宙 更新时间:2023-11-03 19:43:21 27 4
gpt4 key购买 nike

我不知道为什么即使在 pip 安装之后也无法导入 selenium 。有谁知道我还能如何排除故障或解决此问题?

我使用的是 Mac 操作系统和 python 3.7.4

python3                                                  
Python 3.7.4

Type "help", "copyright", "credits" or "license" for more information.
>>> import selenium
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'selenium'
>>>
pip3 install selenium
Requirement already satisfied: selenium in /usr/local/lib/python3.7/site-packages
Requirement already satisfied: urllib3 in /usr/local/lib/python3.7/site-packages (from selenium)

更新

我有点乱七八糟,我所做的一件事帮助它成功了。我不确定哪些项目,但如果有人可以解释一下,以便我将来理解这一点,那将不胜感激。

  1. 我做了brew doctor,输出了以下内容
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!

Warning: A newer Command Line Tools release is available.
Update them from Software Update in System Preferences or
https://developer.apple.com/download/more/.


Warning: You have unlinked kegs in your Cellar.
Leaving kegs unlinked can lead to build-trouble and cause brews that depend on
those kegs to fail to run properly once built. Run `brew link` on these:
python
  • brew 链接 --overwrite python
  • vi/usr/local/bin/pip并将 /usr/local/opt/python/bin/python3.7 更改为 /usr/local/opt/python/bin/python3 并且它有效我猜我的问题是我安装了两个 python 实例,因此它将 selenium 库下载到不同的 python 版本 (3.7),而不是我想要的 3。
  • 如果您认为这是问题所在,或者您是否可以澄清您认为问题所在,请告诉我

    最佳答案

    尝试 pip install,而不是 pip3

    关于python - Selenium "No module named ' selenium'“即使在 pip3 安装之后,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60299178/

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