bwiley1 / pandleau

A quick and easy way to convert a Pandas DataFrame to a Tableau .hyper or .tde extract.
MIT License
61 stars 19 forks source link

ModuleNotFoundError: No module named 'tableasdk.HyperExtract' #3

Closed MaxPowerWasTaken closed 6 years ago

MaxPowerWasTaken commented 6 years ago

Hey thanks for creating this library.

I just installed tableausdk(TableauSDK-10300.18.0510.1135) and ran its setup.py, then pip installed pandleau. But when running either import pandleau or from pandleau import *, I get this error:

>>> from pandleau import *
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/maxepstein/myproject/myenv/lib/python3.6/site-packages/pandleau/__init__.py", line 1, in <module>
    from . import pandleau
  File "/Users/maxepstein/myproject/myenv/lib/python3.6/site-packages/pandleau/pandleau.py", line 11, in <module>
    from tableausdk.HyperExtract import *
ModuleNotFoundError: No module named 'tableausdk.HyperExtract'

Navigating to my myproject/myenv/lib/python3.6/site-packages/tableausdk and running ls, I can confirm there's no HyperExtract module there.

Looking up this issue on Tableau help, I see ["Note: Use the Extract API 2.0 to create .hyper files for Tableau 2018.1 and later. Use the Tableau SDK to create .tde files for previous versions of Tableau."](https://onlinehelp.tableau.com/current/api/sdk/en-us/help.htm)

But Pandleau says it requires the Tableausdk and then exports .hyper files. Is there something I missed installing, or am I using this wrong? Thanks

bwiley1 commented 6 years ago

Hi MaxPowerWasTaken,

Thanks for reaching out and bringing this to my attention!

Tableau updated their original tableausdk package with the new Extract API 2.0 package, which is similar to the original but a few changes were made - mainly, adding the .hyper extension and removing the .tde extension. I went ahead and updated the pandleau module to use the .hyper extension, but you can look back at old commits to see another version for .tde files (it's a little slower than the current version, however) in case you are using an older version of tableau.

The best way to install the updated tableausdk Python package is via the following link:

https://onlinehelp.tableau.com/current/api/extract_api/en-us/help.htm#Extract/extract_api_installing.htm%3FTocPath%3D_____3

Unfortunately, this doesn't appear to be overwriting the original tableausdk module (perhaps to give some users compatibility with .tde files), so you'll have to delete the file you've specified above,

myproject/myenv/lib/python3.6/site-packages/tableausdk

and replace it with the updated tableausdk module.

Let me know if this helps or if you have any other issues with pandleau. Thanks!

MaxPowerWasTaken commented 6 years ago

Awesome, thanks for the answer. Bummer to see at the link you provided that the Extract 2.0 API, "For Python, you must have Python 2.6 or 2.7 installed. (Python 3 is not supported.)"

Anyway, thanks again

bwiley1 commented 6 years ago

Yeah, I don't know why Tableau chooses to use only Python 2 - I feel like adding compatibility with Python 3 would be a great update to their tableausdk module. Let me know if you have any other issues, thanks!