Cannot start server
Closed this issue · 2 comments
I successfully installed plotar
via pip as in the README. But in jupyter
I get the following exception:
---------------------------------------------------------------------------
HTTPError Traceback (most recent call last)
Cell In[17], line 1
----> 1 plotar.plotar(iris.data, iris.target)
File [~/miniforge3/lib/python3.10/site-packages/plotar/client.py:84](http://localhost:8888/lab/tree/VR/~/miniforge3/lib/python3.10/site-packages/plotar/client.py#line=83), in plotar(data, col, size, xyz, type, lines, label, axis_names, col_labels, name, description, speed, auto_scale, digits, host, return_data, push_data)
82 if push_data:
83 plot_host = get_host(host)
---> 84 plot_host.post(json=body)
85 if return_data:
86 return body
File [~/miniforge3/lib/python3.10/site-packages/plotar/client.py:214](http://localhost:8888/lab/tree/VR/~/miniforge3/lib/python3.10/site-packages/plotar/client.py#line=213), in PlotHost.post(self, json)
212 def post(self, json):
213 response = requests.post(self.internal_url(""), json=json, headers=self.headers)
--> 214 response.raise_for_status()
File [~/miniforge3/lib/python3.10/site-packages/requests/models.py:1021](http://localhost:8888/lab/tree/VR/~/miniforge3/lib/python3.10/site-packages/requests/models.py#line=1020), in Response.raise_for_status(self)
1016 http_error_msg = (
1017 f"{self.status_code} Server Error: {reason} for url: {self.url}"
1018 )
1020 if http_error_msg:
-> 1021 raise HTTPError(http_error_msg, response=self)
HTTPError: 403 Client Error: Forbidden for url: http://localhost:8888/plotar/
Then, I tried starting a server manually, but I do not have any executable plotar
such that I could execute plotar server -p 2908
I must be missing something. Is there another step needed in the installation perhaps?
Hi @philippeller !
Sorry for the delayed answer. Cool that you are trying PlotAR out :-)
So the plotar.plotar() command still goes for the endpoint in your Jupyter Server. That can only work, when PlotAR is installed when jupyter lab is started. Did you restart jupyterlab after installing plotAR? Then the 403 Error suggests, that the client did not get the password or token to connect to jupyterlab. There is some heuristics to find these parameters, but they seem to fail in your case?
If you want to go for the plotar server then you need to specify it e.g. using
plotar.set_default_host("http://localhost:2908")
# or directly in the command
plotar.plotar(iris.data, iris.target, host="http://localhost:2908")
Can you get it working like that?
PS: The error handling should be much more clear here - I'll put it on the ToDo List.
Hi, Thanks a lot for the reply and sorry for my very delayed answer! I now came back to this, and what helped to get it working was to Install it from source. The installation via pypi, for some reason, does not work for me.