Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/291.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python “不可能”;来自selenium import webdriver“;_Python_Selenium_Selenium Webdriver - Fatal编程技术网

Python “不可能”;来自selenium import webdriver“;

Python “不可能”;来自selenium import webdriver“;,python,selenium,selenium-webdriver,Python,Selenium,Selenium Webdriver,我已经做了“pip安装selenium”和“pip安装-U selenium” 但每次我试着这么做的时候 import time import pandas as pd from os import environ from selenium import webdriver from selenium.webdriver.common.keys import Keys 我得到这个错误 File "<ipython-input-4-93833772b63f>",

我已经做了“
pip安装selenium
”和“
pip安装-U selenium

但每次我试着这么做的时候

import time
import pandas as pd
from os import environ
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
我得到这个错误

File "<ipython-input-4-93833772b63f>", line 1, in <module>
    from selenium import webdriver

ModuleNotFoundError: No module named 'selenium'
文件“”,第1行,在
从selenium导入webdriver
ModuleNotFoundError:没有名为“selenium”的模块
有人知道如何解决这个问题吗


非常感谢

您使用的是
anaconda
(或其他类似的框架),还是刚刚安装了
python
ipython
?如果您安装了
anaconda
,请尝试在
conda终端
上运行命令
pip install selenium
,而不是在
os终端
上运行。这看起来像是一个环境问题…我正在使用spyderCheck这篇文章:
spyder
是唯一的IDE(带扩展的编辑器)-你必须知道你使用什么Python来运行代码。您可以在代码中使用
sys.executable
来获取它。当您获得可执行
python
的完整路径时,您可以在控制台/终端
/full/path/python-m pip install selenium
中使用它。您使用的是
anaconda
(或其他类似的框架),还是刚刚安装了
python
ipython
?如果您安装了
anaconda
,请尝试在
conda终端
上运行命令
pip install selenium
,而不是在
os终端
上运行。这看起来像是一个环境问题…我正在使用spyderCheck这篇文章:
spyder
是唯一的IDE(带扩展的编辑器)-你必须知道你使用什么Python来运行代码。您可以在代码中使用
sys.executable
来获取它。当您获得可执行文件
python
的完整路径时,您可以在控制台/终端
/full/path/python-m pip install selenium中使用它