安装pip后无法导入智能表

问题描述 投票:0回答:1

使用python的Smartsheet API初学者需要帮助

嗨,大家好。我正在研究smartsheet API,我正试图关注网站,先从https://smartsheet-platform.github.io/api-docs/#sdks-and-sample-code获得一些练习。我在Mac上有python 2.7.15,所以我做的第一步是下载pip文件夹,在我的终端上输入“pip install smartsheet-python-sdk”来安装pip。然后我使用我的.py文件测试代码,我运行第一行import smartsheet并且已经有错误。

我收到的消息如下,任何建议将不胜感激:

Traceback (most recent call last):
  File "/Users/my name /Desktop/charity.py", line 6, in <module>
    import smartsheet
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/smartsheet/__init__.py", line 31, in <module>
    from .smartsheet import Smartsheet, fresh_operation, AbstractUserCalcBackoff  # NOQA
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/smartsheet/smartsheet.py", line 34, in <module>
    from .models import Error, ErrorResult
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/smartsheet/models/__init__.py", line 21, in <module>
    from .access_token import AccessToken
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/smartsheet/models/access_token.py", line 20, in <module>
    from ..types import *
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/smartsheet/types.py", line 26, in <module>
    from enum import Enum
ImportError: No module named enum
python python-2.7 pip
1个回答
1
投票

enum模块was added in Python 3.4但你使用的是Python 2.7。智能表平台声称支持Python 2.7,但它也是requires the importenum才能工作。

您可以向项目提交问题,并希望他们修复它或升级到Python 3.4及更高版本。

© www.soinside.com 2019 - 2024. All rights reserved.