Hi all,
I have trouble with using Plotly-Orca to export plots as PDFs and I assume the problem comes from the language of my operating system (Ubuntu 18.04 LTS natively installed in French).
Everything seems correctly installed and up-to-date.
I’ve been using Plotly with Python for research and it works well. However, now I would like to export my plots to something that can be integrated in a PDFLatex document. I tried SVG but it breaks the font size and style. Therefore I would like to export my plots as PDFs.
I followed the instructions at:
Static image export in Python
Orca is installed correctly with Miniconda:
$ which orca
/usr/bin/orca
$ orca --version
3.28.0
I am using the up-to-date Python executable that was downloaded by Miniconda:
$ python --version
Python 3.7.1
And an up-to-date version of Plotly, where orca is correctly configured:
>>> import plotly
>>> plotly.__version__
'3.4.1'
>>> plotly.io.orca.config.executable
'orca'
When executing line plotly.io.write_image(fig, 'testpdf.pdf')
, I have the following error, and my guess is that is it linked to the help message of Orca being in French and not in English as Plotly may expect:
The orca executable is required in order to export figures as static images,
but the executable that was found at ‘/usr/bin/orca’
does not seem to be a valid plotly orca executable. Please refer to the end of
this message for details on what went wrong.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
GitHub - plotly/orca: Command line application for generating static images of interactive plotly charts.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 theplotly.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/pythonThe error encountered is that unexpected output was returned by the command
$ /usr/bin/orca --helpb"Usage\xc2\xa0: orca [-h] [-v] [-r] [-s] [-l] [-e OPTION] [-d OPTION] [-p NOM]\n [-u R\xc3\x89PERTOIRE] [–debug-file FICHIER] [–debug]\n\nParam\xc3\xa8tres facultatifs:\n -h, --help Montrer ce message d\xe2\x80\x99aide et quitter\n -v, --version 3.28.0\n -r, --replace Remplace une instance actuellement lanc\xc3\xa9e de\n ce lecteur d’\xc3\xa9cran\n -s, --setup D\xc3\xa9finit les pr\xc3\xa9f\xc3\xa9rences utilisateur (mode\n graphique)\n -l, --list-apps Affiche les applications lanc\xc3\xa9es connues\n -e OPTION, --enable OPTION Force l\xe2\x80\x99utilisation de l\xe2\x80\x99option\n -d OPTION, --disable OPTION Emp\xc3\xaache l\xe2\x80\x99utilisation de l\xe2\x80\x99option\n -p NOM, --profile NOM Charge le profil\n -u R\xc3\x89PERTOIRE, --user-prefs R\xc3\x89PERTOIRE\n Utilise un r\xc3\xa9pertoire alternatif pour les\n pr\xc3\xa9f\xc3\xa9rences des utilisateurs\n --debug-file FICHIER Envoie la sortie de d\xc3\xa9bogage dans le fichier\n indiqu\xc3\xa9\n --debug Envoie la sortie de d\xc3\xa9bogage dans debug-AAAA-\n MM-JJ-HH:MM:SS.out\n\nRapportez les bogues \xc3\xa0 orca-list@gnome.org.\n"
Indeed, when I run orca --help
, the help message is in French (as reported by the error).
Have you encountered the same error before? Any hints?
Thanks in advance!