tableau / TabPy

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

Erorr when run TabPy server on Ubuntu #586

Closed samanalyst1 closed 1 year ago

samanalyst1 commented 1 year ago

Environment information:

I had installed python 3.9 on my server and install tabpy package by command -- python3.9 pip install tabpy. When I run tabpy.py - to run a server, it crashes with following error: " Traceback (most recent call last): File "tabpy.py", line 48, in main() File "tabpy.py", line 41, in main from tabpy.tabpy_server.app.app import TabPyApp ModuleNotFoundError: No module named 'tabpy.tabpy_server'; 'tabpy' is not a package " - but tabpy.tabpy_server is exist in packages

Can you help me please, how to fix it or how to run tabpy-server on ubuntu-server - is it possible?))

samanalyst1 commented 1 year ago

Problem was in name of module and package. Module have the same name as package - "tabpy" and when it run, it confused and does not found others packages like tabpy_server... solution:

  1. rename "tabpy.py" --> "new_tabpy.py" and in app.py change "import tabpy.tabpy" --> "import tabpy.new_tabpy" . Or the "true way"
  2. Run script not in tabpy-package folder and put command with full path to "tabpy.py" , like: "python3.9 /path/to/package/tabp.py". - but I didn`t try this method
0golovatyi commented 1 year ago

@samanalyst1 Don't run tabpy.py, run just tabpy command as documentations suggests - https://github.com/tableau/TabPy/blob/master/docs/server-install.md#starting-tabpy