Open sumit-subedi opened 3 years ago
Hi @sumit-subedi, thanks for letting us know.
Do you happen to have a space in the path of your environment?
I think we may need to add better handling of spaces in paths in the kaleido bash file. If so, could you try either:
<my location>/env/lib/python3.8/site-packages/kaleido/executable/kaleido
from cd $DIR
to cd "$DIR"
Thanks @jonmmease . This solved my issue.
Great! BTW, I changed the issue title to reflect what we need to do fix this in kaleido itself.
I am quite sure that this issue is not solved on Windows. Because when Kaleido is installed on windows, its executable file is not directly called by Python.subprocess
, the routine is like this:
flowchart TD
subproc[Python.subprocess]
cmd1[Library\bin\kaleido.cmd]
cmd2[Library\bin\KaleidoApp\kaleido.cmd]
exe[Library\bin\KaleidoApp\bin\kaleido.exe]
subproc --> cmd1 --> cmd2 --> exe
There is a significant issue in Library\bin\kaleido.cmd
. When the installation path (for example, the user folder name) contains a space character
, I need to modify this script like this:
@echo off
-C:/Users/User name/.conda/envs/env-name\Library\bin\KaleidoApp/kaleido.cmd %*
+"C:/Users/User name/.conda/envs/env-name\Library\bin\KaleidoApp/kaleido.cmd" %*
Tested on:
Windows 11, 23H2
python 3.8.17
plotly==5.15.0
kaleido>=0.2.0rc1,<=0.2.1
This issue still persists in the library and seems like a simple fix but hasn't been added yet Can we please fix it in the next version?
I can confirm that replacing the content of venv/lib/python3.12/site-packages/kaleido/executable
with the following resolves this issue about spaces in the path name for me under Ubuntu Linux:
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
export LD_LIBRARY_PATH=$DIR/lib:$LD_LIBRARY_PATH
export FONTCONFIG_PATH=$DIR/etc/fonts
export XDG_DATA_HOME=$DIR/xdg
unset LD_PRELOAD
cd "$DIR"
./bin/kaleido $@
I have seen multiple issues regarding this but not same with mine. I get error every time I try to invoke
write_image()
:ValueError: Failed to start Kaleido subprocess. Error stream:
<my location>/env/lib/python3.8/site-packages/kaleido/executable/kaleido: line 9: cd: too many arguments
<my location>/env/lib/python3.8/site-packages/kaleido/executable/kaleido: line 10: ./bin/kaleido: No such file or directory
Can anyone help me with this issue?