question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Python3.6.9 azure-storage-blob: TypeError: new enumerations must be created as `ClassName([mixin_type,] enum_type)`

See original GitHub issue
  • Package Name: azure-storage-blob
  • Package Version: 12.7.0, 12.7.1
  • Operating System: Ubuntu
  • Python Version: 3.6.9

Describe the bug A clear and concise description of what the bug is.

Python 3.6.9 (default, Jul  3 2019, 15:36:16)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import azure.storage.blob
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/qizhen/.local/lib/python3.6/site-packages/azure/storage/blob/__init__.py", line 10, in <module>
    from ._blob_client import BlobClient
  File "/home/qizhen/.local/lib/python3.6/site-packages/azure/storage/blob/_blob_client.py", line 24, in <module>
    from ._shared.base_client import StorageAccountHostsMixin, parse_connection_str, parse_query
  File "/home/qizhen/.local/lib/python3.6/site-packages/azure/storage/blob/_shared/base_client.py", line 44, in <module>
    from .constants import STORAGE_OAUTH_SCOPE, SERVICE_HOST_BASE, CONNECTION_TIMEOUT, READ_TIMEOUT
  File "/home/qizhen/.local/lib/python3.6/site-packages/azure/storage/blob/_shared/constants.py", line 8, in <module>
    from .._generated import AzureBlobStorage
  File "/home/qizhen/.local/lib/python3.6/site-packages/azure/storage/blob/_generated/__init__.py", line 9, in <module>
    from ._azure_blob_storage import AzureBlobStorage
  File "/home/qizhen/.local/lib/python3.6/site-packages/azure/storage/blob/_generated/_azure_blob_storage.py", line 19, in <module>
    from .operations import ServiceOperations
  File "/home/qizhen/.local/lib/python3.6/site-packages/azure/storage/blob/_generated/operations/__init__.py", line 9, in <module>
    from ._service_operations import ServiceOperations
  File "/home/qizhen/.local/lib/python3.6/site-packages/azure/storage/blob/_generated/operations/_service_operations.py", line 15, in <module>
    from .. import models as _models
  File "/home/qizhen/.local/lib/python3.6/site-packages/azure/storage/blob/_generated/models/__init__.py", line 10, in <module>
    from ._models_py3 import AccessPolicy
  File "/home/qizhen/.local/lib/python3.6/site-packages/azure/storage/blob/_generated/models/_models_py3.py", line 15, in <module>
    from ._azure_blob_storage_enums import *
  File "/home/qizhen/.local/lib/python3.6/site-packages/azure/storage/blob/_generated/models/_azure_blob_storage_enums.py", line 29, in <module>
    class AccessTier(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
  File "/usr/lib/python3.6/enum.py", line 119, in __prepare__
    member_type, first_enum = metacls._get_mixins_(bases)
  File "/usr/lib/python3.6/enum.py", line 441, in _get_mixins_
    raise TypeError("new enumerations must be created as "
TypeError: new enumerations must be created as `ClassName([mixin_type,] enum_type)`

To Reproduce Steps to reproduce the behavior:

  1. pip install azure-storage-blob
  2. python3 import azure.storage.blob

BTW, Version 12.6.0 works fine.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:13 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
tasherif-msftcommented, Dec 17, 2021

@lmazuel sounds good. I can put out PRs to update the packages!

1reaction
qizhen816commented, Dec 2, 2021

It looks the error occurs again in the newest version. @deeTEEcee reported and my colleague found it too.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Fix 'new enumerations must be created as' - Stack Overflow
The error is because you need to list the MixinType before your Enum class, like: class FunEnum(int, Enum): A = 1 B =...
Read more >
new enumerations should be created as `enumname ...
The error is because you need to list the MixinType before your Enum class, ... as " TypeError: new enumerations must be created...
Read more >
enum — Support for enumerations — Python 3.11.1 ...
In Python 3.12 it will be possible to check for member values and not just members; until then, a TypeError will be raised...
Read more >
Build Enumerations of Constants With Python's Enum
Because enumeration members must be constants, Python doesn't allow you to assign new values to enum members at runtime:.
Read more >
Enum in Python - Tutorialspoint
Using type() we can check the enum types. Example. import enum # Using enum class create enumerations class ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found