Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify work with external server #1914

Closed
dev-dsp opened this issue Nov 20, 2019 · 3 comments · Fixed by #1915
Closed

Clarify work with external server #1914

dev-dsp opened this issue Nov 20, 2019 · 3 comments · Fixed by #1915
Milestone

Comments

@dev-dsp
Copy link

dev-dsp commented Nov 20, 2019

I started orca as shown here: https://github.com/plotly/orca#method-3-docker
So I got it on 9091 port on localhost accessible

I've installed plotly==4.3.0 with latest "feature" from #1850

Now, when running following code, I get two terminal screens of errors and cool stories about how to install that orca executable, which I actually should not have to keep in my host system when using orca server:

import plotly.io as pio
import plotly.graph_objects as go
pio.orca.config.server_url = "localhost"
pio.orca.config.port = 9091
pio.to_image(go.Figure())

Could you please clarify, how to use that new feature? since for now it is just useless without binary in PATH.

@miriad
Copy link
Contributor

miriad commented Nov 20, 2019

Please try including the port directly in server_url, such as "localhost:9091"

The port field is intended for use with a locally managed server, and setting will override the server_url field

@dev-dsp
Copy link
Author

dev-dsp commented Nov 20, 2019

Thanks @miriad for such quick answer!

However, with following lines

import plotly.io as pio
import plotly.graph_objects as go
pio.orca.config.server_url = "http://localhost:9091"
pio.to_image(go.Figure())

I still get completely the same output with the same errors.
Attaching traceback for a better understanding of what is happening:

>>> pio.to_image(go.Figure())
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/ns.ops/.local/share/virtualenvs/project-BSL7RaPy/lib/python3.6/site-packages/plotly/io/_orca.py", line 1533, in to_image
    ensure_server()
  File "/home/ns.ops/.local/share/virtualenvs/project-BSL7RaPy/lib/python3.6/site-packages/plotly/io/_orca.py", line 1389, in ensure_server
    validate_executable()
  File "/home/ns.ops/.local/share/virtualenvs/project-BSL7RaPy/lib/python3.6/site-packages/plotly/io/_orca.py", line 1087, in validate_executable
    instructions=install_location_instructions,
ValueError: 
The orca executable is required to export figures as static images,
but it could not be found on the system path.

...

@nicolaskruchten nicolaskruchten added this to the v4.3.1 milestone Nov 22, 2019
@MaximeWeyl
Copy link

MaximeWeyl commented Nov 27, 2019

I have the same issue when using orca on a remote url :
The orca executable is required to export figures as static images,
but it could not be found on the system path.

I found a workaround to insert before to_image or write_image :

plotly.io.orca.status._props["state"] = "validated"

This workaround allow me to get my image through my remote server :-)
Seems like a plotly.py's bug to me.

@jonmmease jonmmease modified the milestones: v4.3.1, v4.4.0 Dec 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants