tableau / TabPy

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

Did someone ever make it worked on --CentOS-- Amazon Linux #223

Closed aharonen closed 5 years ago

aharonen commented 5 years ago

No matter where I go with this setup i am getting a lot of errors. The last one I have received is ValueError: bad marshal data (unknown type code) here I gave up, did Someone have a clue what could be the reason for that failure? Below is the full output of the startup.sh command.

Installing tabpy-server dependencies... running install running bdist_egg running egg_info writing tabpy_server.egg-info/PKG-INFO writing dependency_links to tabpy_server.egg-info/dependency_links.txt writing requirements to tabpy_server.egg-info/requires.txt writing top-level names to tabpy_server.egg-info/top_level.txt package init file 'tabpy_server/static/init.py' not found (or not a regular file) reading manifest file 'tabpy_server.egg-info/SOURCES.txt' writing manifest file 'tabpy_server.egg-info/SOURCES.txt' installing library code to build/bdist.linux-x86_64/egg running install_lib running build_py copying tabpy_server.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO copying tabpy_server.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO copying tabpy_server.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO copying tabpy_server.egg-info/requires.txt -> build/bdist.linux-x86_64/egg/EGG-INFO copying tabpy_server.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO zip_safe flag not set; analyzing archive contents... Traceback (most recent call last): File "setup.py", line 49, in 'urllib3' File "/usr/lib/python3.7/site-packages/setuptools/init.py", line 129, in setup return distutils.core.setup(attrs) File "/usr/lib64/python3.7/distutils/core.py", line 148, in setup dist.run_commands() File "/usr/lib64/python3.7/distutils/dist.py", line 966, in run_commands self.run_command(cmd) File "/usr/lib64/python3.7/distutils/dist.py", line 985, in run_command cmd_obj.run() File "/usr/lib/python3.7/site-packages/setuptools/command/install.py", line 67, in run self.do_egg_install() File "/usr/lib/python3.7/site-packages/setuptools/command/install.py", line 109, in do_egg_install self.run_command('bdist_egg') File "/usr/lib64/python3.7/distutils/cmd.py", line 313, in run_command self.distribution.run_command(command) File "/usr/lib64/python3.7/distutils/dist.py", line 985, in run_command cmd_obj.run() File "/usr/lib/python3.7/site-packages/setuptools/command/bdist_egg.py", line 218, in run os.path.join(archive_root, 'EGG-INFO'), self.zip_safe() File "/usr/lib/python3.7/site-packages/setuptools/command/bdist_egg.py", line 269, in zip_safe return analyze_egg(self.bdist_dir, self.stubs) File "/usr/lib/python3.7/site-packages/setuptools/command/bdist_egg.py", line 379, in analyze_egg safe = scan_module(egg_dir, base, name, stubs) and safe File "/usr/lib/python3.7/site-packages/setuptools/command/bdist_egg.py", line 416, in scan_module code = marshal.load(f) ### ValueError: bad marshal data (unknown type code)**

0golovatyi commented 5 years ago

@aharonen on https://github.com/tableau/TabPy/blob/master/docs/server-configurations.md there is CentOS configuration confirmed to work for TabPy. I see you are using Python 3.7, what is your CensOS version?

aharonen commented 5 years ago

I am using aws ec2, i think it is not CentOS (my bad). Bellow are all of the server details. BTW you have any idea what is the cause for error message?

Operating System: Amazon Linux 2 CPE OS Name: cpe:2.3:o:amazon:amazon_linux:2 Kernel: Linux 4.14.77-81.59.amzn2.x86_64 Architecture: x86-64

0golovatyi commented 5 years ago

@aharonen my bet is on one of the packages (probably setup-tools) is either too old or alpha version. Could you run pip list?

aharonen commented 5 years ago

Thanks mate 👍 setuptools 38.4.0

0golovatyi commented 5 years ago

I checked mine and it is 40.7.3. Could you run pip install setuptools==40.7.3 and try startup again?

aharonen commented 5 years ago

(574kB) 100% |████████████████████████████████| 583kB 2.2MB/s Installing collected packages: setuptools Successfully installed setuptools-40.7.3

Still getting the same error. BTW I am using the 0.3.2.tar.gz release.

0golovatyi commented 5 years ago

@aharonen I need some time to look into the issue. Will get back to you.

WillAyd commented 5 years ago

Did you previously try compiling this on Py27? This SO article suggests its because of dangling Py27 .pyc files:

https://stackoverflow.com/questions/30861493/how-to-fix-python-valueerrorbad-marshal-data

You should see if you have anything laying around that's not from Python3 (i.e. not located in a pycache directory):

find . -name "*.pyc"

And remove accordingly

0golovatyi commented 5 years ago

@aharonen Did suggest cache cleaning work for you?

nmannheimer commented 5 years ago

@aharonen, currently TabPy is not supported for Amazon Linux. To correct this issue today I would suggest using an AWS machine with one of the supported Linux kernels for TabPy. This is something we will continue to explore and may address in future releases.

WillAyd commented 5 years ago

@aharonen depending on use case you might also want to check out a tool called AltTabPy which I just released. This is available from PyPi via wheels so shouldn't require a a build system:

https://alttabpy.readthedocs.io/en/latest/

It has less functionality than TabPy (no auth, no client/tools package) but if you are just simply trying to execute Python code might do the trick