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

tabpy_client.rest.ResponseError: (500) error adding endpoint "FileNotFoundError #111

Closed kabelak closed 5 years ago

kabelak commented 6 years ago

This occurs when using setting the client to an external webserver. When using localhost, it works fine. Sample code:

import tabpy_client

client = tabpy_client.Client('http://tabpy.xxx.com:9004/')

def add(x,y):
    import numpy as np
    return np.add(x, y).tolist()

client.deploy('add', add, 'adds two numbers')

Full description of error:

Traceback (most recent call last): File "tabpy_load.py", line 9, in client.deploy('add', add, 'adds two numbers') File "C:\Program Files (x86)\Python36-32\lib\site-packages\tabpy_client\client.py", line 328, in deploy self._service.add_endpoint(_Endpoint(**obj)) File "C:\Program Files (x86)\Python36-32\lib\site-packages\tabpy_client\rest_client.py", line 219, in add_endpoint endpoint.to_json() File "C:\Program Files (x86)\Python36-32\lib\site-packages\tabpy_client\rest.py", line 172, in POST return self.network_wrapper.POST(self.endpoint + url, data, timeout) File "C:\Program Files (x86)\Python36-32\lib\site-packages\tabpy_client\rest.py", line 108, in POST self.raise_error(response) File "C:\Program Files (x86)\Python36-32\lib\site-packages\tabpy_client\rest.py", line 63, in raise_error raise ResponseError(response) tabpy_client.rest.ResponseError: (500) error adding endpoint "FileNotFoundError : [Errno 2] No such file or directory: '/home/ec2-user/anaconda3/envs/Tableau-Python-Server/lib/python3.6/site-packages/tabpy_server/staging\\endpoints\\add\\1'"

WillAyd commented 6 years ago

Looking at your traceback I'm going to guess that the issue is that the server is mangling Windows and Linux path extensions, hence why it is working on your PC but not on the Linux AWS instance you have

nmannheimer commented 6 years ago

Hi @kabelak, I believe the error you are seeing is related to TabPy only supporting deployment of functions on localhost as noted in the issue below. This is a capability that we are aware has been requested from users. As things stand now, you should be able to deploy the function locally on the webserver using your code sample.

https://github.com/tableau/TabPy/issues/64

aneshr commented 3 years ago

Hi @nmannheimer , Is the deployment of function to the external server still not supported or now this functionality is supported? Like if we have tabpy server hosted on an aks server, or we are trying to do container deployment of the tabpy...

Kwizeraj commented 1 year ago

Does anyone knows any way around this? I still can't deploy python functions to a remote server. Any kind of insights will be appreciated.