“模块”对象没有属性“ ImageRequestOptions”

时间:2018-08-29 08:47:29

标签: python tableau-server

我试图以png图像格式下载Tableau Workbook,并使用tableauserverclient使用来自GitHub的示例:https://github.com/tableau/server-client-python/blob/master/samples/download_view_image.py。但是我从上面得到了错误。我想我可能还需要导入更多内容,我只导入tableauserverclient。有人知道我做错了什么吗?

相关代码:

import argparse
import getpass
import logging

import tableauserverclient as TSC

步骤3:查询图像端点并将图像保存到指定位置

image_req_option = TSC.ImageRequestOptions    (imageresolution=TSC.ImageRequestOptions.Resolution.High)
    server.views.populate_image(view_item, image_req_option)
with open(args.filepath, "wb") as image_file:
    image_file.write(view_item.image)

print("View image saved to {0}".format(args.filepath))`

完整错误消息:

Traceback (most recent call last):
  File "pdf2.test.py", line 69, in <module>
    main()
  File "pdf2.test.py", line 59, in main
    image_req_option = TSC.ImageRequestOptions(imageresolution=TSC.ImageRequestO                                                                  ptions.Resolution.High)
AttributeError: 'module' object has no attribute 'ImageRequestOptions'

0 个答案:

没有答案