PermissionError: [Errno 13] Permission denied: 'temp-plot.html'

Hi everyone

Why do I get This error???

PermissionError: [Errno 13] Permission denied: ‘temp-plot.html’

The Code that I Used is this:

import plotly.graph_objects as go
from plotly.offline import plot
fig.add_trace(go.Scatter(x=[1.5, 0.5, 0.5, 2, 5, 8], y=[2, 5, 8, 10, 10, 1]))
plot(fig, auto_open=True)

I need to work with plotly.offline.plot!

hi @Bijan

I tried running your code and I get this plot:

I didn’t get any error. What Plotly version are you using? When do you get this error?

Hi @adamschroeder

Thanks for the response. Today I think something strange happened because I didn’t get these errors before! In the following you can see my installed versions:

please guide me if you found any mistake. Thanks

Bijan, I can’t tell the reason for the error by looking at what you shared. Hopefully another community would be able to spot it.

In the meantime, I recommend starting a new virtual environment and installing plotly anew. See if that helps.

1 Like

Can you check if the generated file (should be named temp_plot.html) is read-only or if some other process is blocking it? I was able to force this error message by setting the file manually to Read-only…

Dear @adamschroeder

According comments on PermissionError: [Errno 13] Permission denied I changed the permissions on the python executable (I Really Afraid of it) and It worked!!! Seems this problem mostly is from windows issues or as you said environment issue But certainly there is no problem from plotly.

Thanks @yanboe for your contribution on this error. In the directory of the script file there is no temp_plot.html generated file. Should I search some where else?

You can see the file path in your browser address bar. Just run your program and wait for it to open the file (with auto_open=True). For me it’s located in the same directory as my .py file running your code from above.