我正在尝试在Mac上构建一个简单的python (python3)网络爬行器。我用很多不同的方式安装了Selenium,但每次运行web抓取程序时,输出都是这样的:
Traceback (most recent call last):
File "/Users/username/Desktop/instagram_bot.py", line 1, in <module>
from selenium import webdriver
ImportError: No module named selenium
[Finished in 0.6s with exit code 1]
[shell_cmd: python -u "/Users/username/Desktop/instagram_bot.py"]
[dir: /Users/username/Desktop]
[path: /Users/username/opt/anaconda3/bin:/Users/username/opt/anaconda3/condabin:/Users/username/anaconda3/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin]这是一个常见的问题,但我还没有找到解决方案。
发布于 2020-01-26 02:29:35
Selenium包未正确安装。
如果您已经安装了pip,那么可以这样安装selenium。
窗口:
pip install seleniumUnix:
sudo pip install selenium发布于 2020-01-26 03:40:45
您可能有多个python安装。
您可以通过以下方式使用当前安装的python安装模块:
python -m pip install --user --upgrade --no-cache seleniumhttps://stackoverflow.com/questions/59912104
复制相似问题