tableau / TabPy

Execute Python code on the fly and display results in Tableau visualizations:
https://tableau.github.io/TabPy/
MIT License
1.55k stars 592 forks source link

Tableau Prep Builder TabPY ModuleNotFoundError #460

Closed krisk360media closed 3 years ago

krisk360media commented 3 years ago

Environment information:

Attachments:

  1. Screenshot of Basic script I'm trying to import. (I can't attach the csv file that's being read in my python script because it has sensitive information). Also, I tried attached the .py file but GitHub doesn't support that file being attached?!

    Screen Shot 2020-10-09 at 1 50 39 PM
  2. Screenshot showing the error I'm getting. The error: 'Something went wrong when running the script. Verify that there are no errors in the script, then try again. ModuleNotFoundError: No module named lifetimes.'

Screen Shot 2020-10-08 at 6 04 02 PM

To Reproduce Connect to the tabpy, using localhost and port 9004 in Tableau Prep Try to import lifetimes module in a python script. P.S. I have this running in a virtual environment, and have installed lifetimes package in my environment.

Expected behavior I should be able to see the new columns created: Count_Emails, OrderDate, Email_ID. I've added empty columns in Tableau Prep so the results should just populate in Tableau Prep

Additional context I've tried with importing lifetimes as: **from lifetimes.utils import * and import lifetime** with both I get an import error.

0golovatyi commented 3 years ago

@krisk360media You can check what Python modules are installed with running pip list command. And with pip install <module-name> you can install pypi module.

krisk360media commented 3 years ago

Hi! @0golovatyi , Thanks for responding! I've added a screenshot of the libraries in my virtual environment and have pypi.

Screen Shot 2020-10-13 at 8 47 30 AM
0golovatyi commented 3 years ago

@krisk360media Since you have an issue with a specific Python package it may worth asking the question on its homepage. I would guess https://github.com/CamDavidsonPilon/lifetimes/issues is a good place to start.

nmannheimer commented 3 years ago

@krisk360media are you sure that the TabPy instance you are calling is running in the same virtual environment where lifetime is installed?

Also just to check, the package in the image you sent with the list is "lifetime" but in your code your are importing "lifetimes" is that correct?

nmannheimer commented 3 years ago

@krisk360media are you still experiencing this issue?