-
Notifications
You must be signed in to change notification settings - Fork 118
plotly.show() does not work on Windows 10 #128
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
Comments
I would gratefully accept a PR with a fix - I'm short on time at the moment to fix this personally. I'm not immediately sure why it works on linux but not Windows; the implementations should be equivalent. |
Hello I was playing with this function and figured it out I will send a pull request with this!! fn show_with_default_app(temp_path: &str) {
use std::process::Command;
Command::new("cmd")
.arg(format!("/Cstart {}", temp_path))
.spawn()
.expect(DEFAULT_HTML_APP_NOT_FOUND);
// .output()
// .expect(DEFAULT_HTML_APP_NOT_FOUND);
}``` |
Closed by #129 |
I also came upon this problem and figured out that it can be resolved by closing the file in Plot::show(), for example enclosing it in a scope, before calling Plot::show_with_default_app(). E.g.:
|
Hmm, I wonder if this is a more robust solution than #129. It's always good to release resources as early as possible for exactly this reason. |
By design, the API "
plot.show()
" would open a default web browser to display an interactive plot.However, under my environment(Windows 10, plotly="0.8.3"), it doesn't work. The default web browser was not opened either.
I found out that there was an issue message from cmd:
The process cannot access the file because it is being used by another process
https://github.com/igiagkiozis/plotly/blob/49bd3a87fbaa3e507e9a2664f57feda89c35b95b/plotly/src/plot.rs#L465
After investigation, I suspect it's because, that the temp html file that should be opened was being used by another process, while this "another" process is the process itself which has not yet close the file handle in Rust program.
Could you fix this please? Thanks! :)
The text was updated successfully, but these errors were encountered: