Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
relunctance opened this issue Nov 15, 2017 · 9 comments

Comments

@relunctance
Copy link

"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

@relunctance
Copy link
Author

pip uninstall enum
pip install enum34

can fixed this bug

@reaperhulk
Copy link
Member

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

@alex
Copy link
Member

alex commented Nov 20, 2017

Dupe of #4010

@alex alex closed this as completed Nov 20, 2017
noamwegner added a commit to QualiSystems/vCenterShell that referenced this issue Mar 28, 2018
…(execution server)

cryptography requests enum34.
vcenter shell  requests enum.

cryptography has  a module name.py that have this code:

from enum import Enum

class _ASN1Type(Enum):
    UTF8String = 12

_ASN1_TYPE_TO_ENUM = dict((i.value, i) for i in _ASN1Type)

this code expects Enum to be enum34 package , if enum lib is also installed it will throw  "TypeError: 'type' object is not iterable"

so we had to remove enum import and change it to enum34 as answered here : pyca/cryptography#4020
noamwegner added a commit to QualiSystems/vCenterShell that referenced this issue Mar 29, 2018
…(execution server)

cryptography requests enum34.
vcenter shell  requests enum.

cryptography has  a module name.py that have this code:

from enum import Enum

class _ASN1Type(Enum):
    UTF8String = 12

_ASN1_TYPE_TO_ENUM = dict((i.value, i) for i in _ASN1Type)

this code expects Enum to be enum34 package , if enum lib is also installed it will throw  "TypeError: 'type' object is not iterable"

so we had to remove enum import and change it to enum34 as answered here : pyca/cryptography#4020
@tannupiyush
Copy link

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?

@harshini4
Copy link

@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.

@tongpinmo
Copy link

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

@spica45
Copy link

spica45 commented Jan 30, 2019

@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

@tongpinmo
Copy link

@nithinn86 ok,thank you very much

@autodataming
Copy link

pipenv install enum34

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

8 participants