Import: cannot import name Certs

Asked

Viewed 666 times

-1

I am running some exercises that I find on the internet. One of them is to use the module requests

I installed the module in /site-Packages, but when I try to import it, the shell returns me the following message:

>>> import requests

Traceback (most recent call last):
 File "<pyshell#1>", line 1, in <module>
import requests
File "C:\Python27\lib\site-packages\requests\__init__.py", line 58, in <module>
from . import utils
File "C:\Python27\lib\site-packages\requests\utils.py", line 24, in <module>
from . import certs
ImportError: cannot import name certs
  • How did you install the module?

  • I did it in two ways. At first, I downloaded the zip from the module and put it in the /site-Packages folder. I used the >> python setup.py install instruction. The second way was using easy_install. I’m using Windows7

  • What version of Python do you use? The requests library only supports versions above Python 2.6. Maybe that’s it... Another test you can do is take the newest version of requests in git: git clone git://github.com/kennethreitz/requests.git.

  • I’m using version 2.7.6 in windows 7. The situation is already solved. I redid the Python installation and got the newest version of requests in git.

1 answer

1


The problem can be solved by reinstalling Python (version 2.7.6), and later the Requests library, directly by git:

git clone git://github.com/kennethreitz/requests.git
cd requests
python setup.py install

Browser other questions tagged

You are not signed in. Login or sign up in order to post.