Error server.auth.sign_in(tableau_auth)
Hello All!
I'm having some trouble with signing in. I copied the example code from https://tableau.github.io/server-client-python/docs/ using the sample code on the "Get Started" section. Below is nearly the same from the website aside from the variables assigned. Is it an issue with a Version of ElementTree or am i missing something obvious?
import tableauserverclient as TSC
tableau_auth = TSC.TableauAuth("[email protected]", "blahpass1234") server = TSC.Server("http://pretendtabserver12345.com/#/site/Chris/projects")
with server.auth.sign_in(tableau_auth): all_datasources, pagination_item = server.datasources.get() print("\nThere are {} datasources on site: ".format(pagination_item.total_available)) print([datasource.name for datasource in all_datasources])
Traceback (most recent call last):
File "
Hey @chrissalter
The issue is that the url you should be using in your example is "http://pretendtabserver12345.com".
If you need to log into a specific site, then the TableauAuth object has an optional parameter called site_id, and you'd pass in "Chris" as that argument to the TableauAuth object. Like this:
tableau_auth = TSC.TableauAuth("[email protected]", "blahpass1234", site_id="Chris")
server = TSC.Server("http://pretendtabserver12345.com/")
Thanks man worked like a charm!
Hi,
I am getting the similar error when I try to login the tableau server.My script is below
_import tableauserverclient as TSC tableau_auth = TSC.TableauAuth('username', 'passwd') server = TSC.Server('http://tabl.server.com')
with server.auth.sign_in(tableau_auth): all_datasources, pagination_item = server.datasources.get() print("\nThere are {} datasources on site: ".format(pagination_item.total_available)) print([datasource.name for datasource in all_datasources])_
and I am getting the following error
Traceback (most recent call last):
File "first.py", line 6, in
I have tried this with python3.6 but no luck.
please help me in fixing this.
Can you open a separate issue for this? Also, can you include the full text of the result that is coming back from the server? You can turn on requests logging by following the instructions here: http://docs.python-requests.org/en/master/api/#api-changes
Also, can you let me know which version of the Tableau server you are hitting?
oops, meant to tag @sasimachi on the above response
download the source code from the pip repo: https://pypi.org/project/tableauserverclient/#files