Problems using the requests library

Asked

Viewed 84 times

0

I am having trouble using python2’s requests library. I have already performed the installation and when I run pip install requests I see she’s already settled in. Someone could help?

Python 2.7.14 (default, Sep 17 2017, 18:50:44) 
[GCC 7.2.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import requests
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/requests-2.18.4-py2.7.egg/requests/__init__.py", line 95, in <module>
    from urllib3.contrib import pyopenssl
  File "/usr/lib/python2.7/dist-packages/urllib3/contrib/pyopenssl.py", line 47, in <module>
    from cryptography import x509
  File "/usr/lib/python2.7/dist-packages/cryptography/x509/__init__.py", line 8, in <module>
    from cryptography.x509.base import (
  File "/usr/lib/python2.7/dist-packages/cryptography/x509/base.py", line 16, in <module>
    from cryptography.x509.extensions import Extension, ExtensionType
  File "/usr/lib/python2.7/dist-packages/cryptography/x509/extensions.py", line 24, in <module>
    from cryptography.x509.general_name import GeneralName, IPAddress, OtherName
  File "/usr/lib/python2.7/dist-packages/cryptography/x509/general_name.py", line 18, in <module>
    from cryptography.x509.name import Name
  File "/usr/lib/python2.7/dist-packages/cryptography/x509/name.py", line 28, in <module>
    _ASN1_TYPE_TO_ENUM = dict((i.value, i) for i in _ASN1Type)
TypeError: 'type' object is not iterable
  • Are you sure the installation was in Python 2.7 and not in some different version?

  • I believe it was version 2.7 right: $ Pip install requests Requirement already satisfied: requests in /usr/local/lib/python2.7/dist-Packages/requests-2.18.4-py2.7.Egg Requirement already satisfied: certifi>=2017.4.17 in /usr/lib/python2.7/dist-Packages (from requests) Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /usr/lib/python2.7/dist-Packages (from requests) Requirement already satisfied: idna<2.7,>=2.5 in /usr/lib/python2.7/dist-Packages (from requests) Requirement already satisfied: urllib3<1.23,>=1.21.1 in /usr/lib/python2.7/dist-Packages (from requests)

  • I haven’t figured it out yet. Some help?

No answers

Browser other questions tagged

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