Hi,
I’m relatively new to Python. I’d like to use Orca and Plotly to save a pdf output of my graph in Plotly. I’m using PyCharm and have installed plotly, orca, requests, electron and psutil from the PyCharm interface. In the directory where all other packages are downloaded, I can see that orca is also available C:\Users\uname\AppDara\Local\Programs\Python\Python37\Lib\site-packages\orca .
However, when I try to run:
plotly.io.write_image(fig,‘images/testpdf.pdf’)
I get the error:
Traceback (most recent call last):
File “C:/Users/uname/PycharmProjects/untitled/currency2.py”, line 75, in
plotly.io.write_image(fig,‘images/testpdf.pdf’)
File “C:\Users\uname\AppDara\Local\Programs\Python\Python37\lib\site-packages\plotly\io_orca.py”, line 1705, in write_image
fig, format=format, scale=scale, width=width, height=height, validate=validate
File “C:\Users\uname\AppDara\Local\Programs\Python\Python37\lib\site-packages\plotly\io_orca.py”, line 1482, in to_image
ensure_server()
File “C:\Users\uname\AppDara\Local\Programs\Python\Python37\lib\site-packages\plotly\io_orca.py”, line 1344, in ensure_server
validate_executable()
File “C:\Users\uname\AppDara\Local\Programs\Python\Python37\lib\site-packages\plotly\io_orca.py”, line 1043, 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.
Searched for executable ‘C:/Users/uname/AppDara/Local/Programs/Python/Python37/Lib/site-packages/orca’ on the following path:
C:\Users\uname\AppDara\Local\Programs\Python\Python37\Scripts
C:\WINDOWS\system32
C:\WINDOWS
C:\WINDOWS\System32\Wbem
C:\WINDOWS\System32\WindowsPowerShell\v1.0
C:\WINDOWS\System32\OpenSSH
C:\Users\uname\AppData\Local\Microsoft\WindowsApps
C:\Users\uname\AppDara\Local\Programs\Python\Python37\lib\site-packages\numpy\.libs
C:\Users\uname\AppDara\Local\Programs\Python\Python37\lib\site-packages\scipy\extra-dll
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.plotly.com/c/api/python
I also read to point the orca executable to point to the directory where orca is installed and I still get the same error.
Can anyone please help to resolve this?
Many thanks!