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

Error with Pyinstaller .exe file (Windows 10) #39

Closed
drdeleon opened this issue Sep 8, 2020 · 5 comments
Closed

Error with Pyinstaller .exe file (Windows 10) #39

drdeleon opened this issue Sep 8, 2020 · 5 comments

Comments

@drdeleon
Copy link

drdeleon commented Sep 8, 2020

While trying to use Plotly and Kaleido (0.0.3.post1) in a Pyinstaller .exe file (Windows 10) I got this error:

`File "kaleido\scopes\plotly.py", line 103, in transform
File "kaleido\scopes\base.py", line 201, in _perform_transform
File "kaleido\scopes\base.py", line 120, in _ensure_kaleido
ValueError: Failed to start Kaleido subprocess. Error stream:

The system cannot find the path specified.`

While doing some research I found out that Pyinstaller has problems with subprocesses and some things should be changed for it to work in Windows .exe files (https://github.com/pyinstaller/pyinstaller/wiki/Recipe-subprocess). I'm not sure if I should change something with my Pyinstaller configuration in order to fix the problem or the subprocess code would fix it for Windows. I would appreciate any help (Kaleido is relatively new so I'm not sure how to proceed and there isn't much info).

@jonmmease
Copy link
Collaborator

Hi @DouglasDL28, thanks for the report.

Would you be willing to create a minimal PyInstaller example that produces this error? We don't have much experience using PyInstaller, so there's a much better chance of someone taking a look if we have this as a starting point. Might be easiest to do this in a small standalone repo, including a README for how to package it, and link it here.

Thanks!

@drdeleon
Copy link
Author

Hi @jonmmease.

While doing the repo for the testing I came across various problems with both Plotly and Kaleido with Pyinstaller again. I found a solution for the Plotly errors online and it occurred to me that maybe the same solution would apply to Kaleido, and it did! For it to work you just need to use the --add-data "c:\users\username\appdata\local\programs\python\python37\lib\site-packages\kaleido\;kaleido".

@jonmmease
Copy link
Collaborator

Glad you got things working! I'm assuming --add-data is a PyInstaller option? It does make sense that this directory would be needed. Are you aware of anything that could be done in the Kaleido Python package itself to help PyInstaller figure this out automatically?

@drdeleon
Copy link
Author

Yes, forgot to mention add-data is a PyInstaller option. I'm sorry but I don't know what can be done to make it work without additional configuration on PyInstaller. The whole purpose of Pyinstaller is to be compatible with 3rd-party packages out-of-the-box, but it is not rare to use additional configuration to make it work. Thanks for the help!

@jonmmease
Copy link
Collaborator

Alright, going to close this issue for now then. Thanks again for updating the issue with your solution!

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

No branches or pull requests

2 participants