Cryptography: TypeError: 'type' object is not iterable in "cryptography/x509/name.py", line 28

Created on 15 Nov 2017  路  9Comments  路  Source: pyca/cryptography

"cryptography/x509/name.py", line 28, in
_ASN1_TYPE_TO_ENUM = dict((i.value, i) for i in _ASN1Type)
TypeError: 'type' object is not iterable

Most helpful comment

@tongpinmo , I had the same issue, was able to solve it by manually removing enum and crapytography. Here are the steps that I did -

  1. Removed enum from "/usr/lib/python2.7/dist-packages": rm -rf enum*
  2. When I tried to install enum34 using "pip install enum34" I still run into the same error from cryptography: "TypeError: 'type' object is not iterable". (I think its because there is a copy of enum present under "/usr/local/lib/python2.7/dist-packages" as well.
  3. Next I removed cryptography from "/usr/lib/python2.7/dist-packages": rm -rf cryptography*
  4. Now try running "pip uninstall enum", it works.
  5. Then install enum34: pip install enum34
  6. Then install cryptography again: pip install cryptography

All 9 comments

pip uninstall enum
pip install enum34

can fixed this bug

We list enum34 in our requirements already. It might make sense to add this to the FAQ though.

Dupe of #4010

i am getting same error!! i am unable to unintsall enum and install enum34..
pip uninstall enum
pip install enum34
By using these commands i am unable fix bug.can i can any solution or reason for this issue?

@tannupiyush Were you able to figure out a solution? Running into the same issue - cannot uninstall enum because running pip uninstall enum gives me the same TypeError.

@harshini4 @tannupiyush have you ever solved the problem ,running pip uninstall enum gives me the same TypeError.

@tongpinmo , I had the same issue, was able to solve it by manually removing enum and crapytography. Here are the steps that I did -

  1. Removed enum from "/usr/lib/python2.7/dist-packages": rm -rf enum*
  2. When I tried to install enum34 using "pip install enum34" I still run into the same error from cryptography: "TypeError: 'type' object is not iterable". (I think its because there is a copy of enum present under "/usr/local/lib/python2.7/dist-packages" as well.
  3. Next I removed cryptography from "/usr/lib/python2.7/dist-packages": rm -rf cryptography*
  4. Now try running "pip uninstall enum", it works.
  5. Then install enum34: pip install enum34
  6. Then install cryptography again: pip install cryptography

@nithinn86 ok,thank you very much

pipenv install enum34

Was this page helpful?
0 / 5 - 0 ratings

Related issues

spencerwilson picture spencerwilson  路  6Comments

DurandA picture DurandA  路  5Comments

webknjaz picture webknjaz  路  7Comments

manjunathb4461 picture manjunathb4461  路  7Comments

ianloic picture ianloic  路  8Comments