0

I am trying to import webdriveer from selenium but it always displays an error

Heres some code:

        from selenium import webdriver

I works if I launch the python interpreter from my cmd and write the code.

But fails if written directly to the python idle.

It leaves me with this long error:

    Traceback (most recent call last): File "", line 1, in from selenium import     webdriver File "C:\Users\User\AppData\Local\Programs\Python\Python37\lib\site-packages\selenium\webdriver__init__.py", 

    line 18, in from .firefox.webdriver import WebDriver as Firefox # noqa File "C:\Users\User\AppData\Local\Programs\Python\Python37\lib\site-packages\selenium\webdriver\firefox\webdriver.py", 


    line 29, in <module>
from selenium.webdriver.remote.webdriver import WebDriver as RemoteWebDriver
File "C:\Users\User\AppData\Local\Programs\Python\Python37\lib\site-packages\selenium\webdriver\remote\webdriver.py", 


    line 27, in <module>
from .remote_connection import RemoteConnection
File "C:\Users\User\AppData\Local\Programs\Python\Python37\lib\site-packages\selenium\webdriver\remote\remote_connection.py", 

    line 24, in <module>
import urllib3
File "C:\Users\User\AppData\Local\Programs\Python\Python37\lib\site-packages\urllib3__init__.py", 



    line 7, in <module>
from .connectionpool import (
File "C:\Users\User\AppData\Local\Programs\Python\Python37\lib\site-packages\urllib3\connectionpool.py", 




    line 11, in <module>
from .exceptions import (
File "C:\Users\User\AppData\Local\Programs\Python\Python37\lib\site-packages\urllib3\exceptions.py", 


    line 2, in <module>
from .packages.six.moves.http_client import (
File "C:\Users\User\AppData\Local\Programs\Python\Python37\lib\site-packages\urllib3\packages\six.py", 



    line 203, in load_module
mod = mod._resolve()
File "C:\Users\User\AppData\Local\Programs\Python\Python37\lib\site-packages\urllib3\packages\six.py", 



    line 115, in _resolve
return _import_module(self.mod)
File "C:\Users\User\AppData\Local\Programs\Python\Python37\lib\site-packages\urllib3\packages\six.py", 



    line 82, in _import_module import(name)    File "C:\Users\User\AppData\Local\Programs\Python\Python37\lib\http\client.py", 



    line 71, in <module>
    import email.parser
    ModuleNotFoundError: No module named 'email.parser'; 'email' is not a package

1 Answers1

-1

Possible that since looks like your running Windows, need to escape the path? Maybe?

Like

C:\\\my\\\escaped\\\path
petezurich
  • 9,280
  • 9
  • 43
  • 57
hbmaddog
  • 64
  • 6