user5841014
user5841014

Reputation: 61

Importing Request library in Python

I am trying to use the Python Library requests using Liclipse. I have added the library but it is giving me the below error message

Traceback (most recent call last):
  File "C:\programming\automate_boring_stuff\test.py", line 1, in <module>
    import requests
  File "C:\programming\libraries\kennethreitz-requests-> > 00fa5f1\requests\__init__.py", line 3, in <module>
    from . import ssl_match_hostname
ImportError: cannot import name ssl_match_hostname

Unusually I was previously using it on another computer and it worked finebut on this one by just running import requests it gives me the above error message.

I have tried researching this but most of the answers I have found have been related to different libraries and I could not find how the fixes related to the requests library.

Upvotes: 0

Views: 1152

Answers (1)

Martijn Pieters
Martijn Pieters

Reputation: 1121266

You have mucked up your installation; you appear to have moved the requests/packages/urllib3/packages/__init__.py file into the top-level requests folder.

Remove the package and re-install.

Upvotes: 2

Related Questions