plotly / orca

Command line application for generating static images of interactive plotly charts
MIT License
296 stars 39 forks source link

orca executable not found #242

Closed FromTravis closed 5 years ago

FromTravis commented 5 years ago

Good morning all,

I keep bumping the error below when trying to make Orca work. Although when using the line: !orca graph “{ “data”: [{“y”: [1,2,60]}] }” -o fig.png on a command window it works.

and second question: to save an image cam you just create the figure and then fig.write_image("images/fig1.png") like in the plotly website ? I m asking because i see posts of people writing about launching the orca server etc.. but i don't really see full codes on how to do so.


ValueError Traceback (most recent call last)

in 1 import plotly.io as pio 2 pio.orca.config ----> 3 pio.write_image(fig, 'images/fig1.png') C:\ProgramData\Anaconda3\lib\site-packages\plotly\io\_orca.py in write_image(fig, file, format, scale, width, height, validate) 1703 # Do this first so we don't create a file if image conversion fails 1704 img_data = to_image( -> 1705 fig, format=format, scale=scale, width=width, height=height, validate=validate 1706 ) 1707 C:\ProgramData\Anaconda3\lib\site-packages\plotly\io\_orca.py in to_image(fig, format, width, height, scale, validate) 1480 # Make sure orca sever is running 1481 # ------------------------------- -> 1482 ensure_server() 1483 1484 # Handle defaults C:\ProgramData\Anaconda3\lib\site-packages\plotly\io\_orca.py in ensure_server() 1342 # Validate orca executable 1343 if status.state == "unvalidated": -> 1344 validate_executable() 1345 1346 # Acquire lock to make sure that we keep the properties of orca_state C:\ProgramData\Anaconda3\lib\site-packages\plotly\io\_orca.py in validate_executable() 1041 executable=config.executable, 1042 formatted_path=formatted_path, -> 1043 instructions=install_location_instructions, 1044 ) 1045 ) ValueError: The orca executable is required to export figures as static images, but it could not be found on the system path. Searched for executable 'C:\ProgramData\Anaconda3\orca_app' on the following path: C:\ProgramData\Anaconda3 C:\ProgramData\Anaconda3\Library\mingw-w64\bin C:\ProgramData\Anaconda3\Library\usr\bin C:\ProgramData\Anaconda3\Library\bin C:\ProgramData\Anaconda3\Scripts C:\ProgramData\Anaconda3\bin C:\ProgramData\Anaconda3\condabin C:\ProgramData\Anaconda3 C:\ProgramData\Anaconda3\Library\mingw-w64\bin C:\ProgramData\Anaconda3\Library\usr\bin C:\ProgramData\Anaconda3\Library\bin C:\ProgramData\Anaconda3\Scripts C:\windows\System32 C:\ProgramData\Anaconda3\orca_app C:\ProgramData\Anaconda3 C:\ProgramData\Anaconda3\scripts C:\ProgramData\Anaconda3\orca_app If you haven't installed orca yet, you can do so using conda as follows: $ conda install -c plotly plotly-orca Alternatively, see other installation methods in the orca project README at https://github.com/plotly/orca. After installation is complete, no further configuration should be needed. If you have installed orca, then for some reason plotly.py was unable to locate it. In this case, set the `plotly.io.orca.config.executable` property to the full path of your orca executable. For example: >>> plotly.io.orca.config.executable = '/path/to/orca' After updating this executable property, try the export operation again. If it is successful then you may want to save this configuration so that it will be applied automatically in future sessions. You can do this as follows: >>> plotly.io.orca.config.save() If you're still having trouble, feel free to ask for help on the forums at https://community.plot.ly/c/api/python
FromTravis commented 5 years ago

I 've navigated around the issue by not using write image method and instead call(['orca', 'graph', json.dumps(fig, cls=plotly.utils.PlotlyJSONEncoder), '-o', 'fig1b','-d','images','-f','svg'])

A pity but it does the job!

DiegoHurtad0 commented 3 years ago

In the terminal $ which orca '/-/anaconda3/bin/orca' ('/path/to/orca')

plotly.io.orca.config.executable = '/-/anaconda3/bin/orca' plotly.io.orca.config.save()