boxsdk demo / auth.py从boxsdk导入OAuth2失败

时间:2017-04-21 01:14:43

标签: python-3.x box

在python 3.6(anaconda)上运行

尝试在boxsdk:demo / auth.py中运行authenticate()并在导入时出错。

在/anaconda/lib/python3.6/site-packages/boxsdk/object/events.py ....中看起来发生了错误。

class EventsStreamType(with_metaclass(ExtendableEnumMeta,TextEnum)):

我确实看过其他帖子,但没有看到解决方案

  1. python - 修复'新枚举必须创建为' - Stack Overflow
  2. boxsdk 1.x不在python 3.6.0中导入·问题#195·盒子/盒子......
  3. 错误

    ---------------------------------------------------------------------------
    TypeError                                 Traceback (most recent call last)
    <ipython-input-33-e86018378e6f> in <module>()
          9 from wsgiref.simple_server import WSGIServer, WSGIRequestHandler, make_server
         10 
    ---> 11 from boxsdk import OAuth2
         12 
         13 
    
    /anaconda/lib/python3.6/site-packages/boxsdk/__init__.py in <module>()
          4 
          5 from .auth import JWTAuth, OAuth2
    ----> 6 from .client import *  # pylint:disable=wildcard-import,redefined-builtin
          7 from .object import *  # pylint:disable=wildcard-import,redefined-builtin
          8 from .version import __version__
    
    /anaconda/lib/python3.6/site-packages/boxsdk/client/__init__.py in <module>()
          3 from __future__ import unicode_literals, absolute_import
          4 
    ----> 5 from .client import Client
          6 from .developer_token_client import DeveloperTokenClient
          7 from .development_client import DevelopmentClient
    
    /anaconda/lib/python3.6/site-packages/boxsdk/client/client.py in <module>()
         10 from ..object.folder import Folder
         11 from ..object.search import Search
    ---> 12 from ..object.events import Events
         13 from ..object.file import File
         14 from ..object.group import Group
    
    /anaconda/lib/python3.6/site-packages/boxsdk/object/events.py in <module>()
         13 
         14 # pylint:disable=too-many-ancestors
    ---> 15 class EventsStreamType(with_metaclass(ExtendableEnumMeta, TextEnum)):
         16     """An enum of all possible values of the `stream_type` parameter for user events.
         17 
    
    /anaconda/lib/python3.6/enum.py in __prepare__(metacls, cls, bases)
        117         enum_dict = _EnumDict()
        118         # inherit previous flags and _generate_next_value_ function
    --> 119         member_type, first_enum = metacls._get_mixins_(bases)
        120         if first_enum is not None:
        121             enum_dict['_generate_next_value_'] = getattr(first_enum, '_generate_next_value_', None)
    
    /anaconda/lib/python3.6/enum.py in _get_mixins_(bases)
        437         # base is now the last base in bases
        438         if not issubclass(base, Enum):
    --> 439             raise TypeError("new enumerations must be created as "
        440                     "`ClassName([mixin_type,] enum_type)`")
        441 
    
    TypeError: new enumerations must be created as `ClassName([mixin_type,] enum_type)`
    

0 个答案:

没有答案