Plotly offline error (always stop on first start)

Hello, I’m glad to write my problem

I wrote a code to create a static image using plotly4.
When I first started it, it stopped for a long time, then I clicked yes to add it to the whitelist in the Windows Defender notification and it worked.
After that, the Windows defender notification does not appear when running, and it runs after 3 seconds of pause.

However, the first time I run this code after turning on the computer, it always hangs. so, I had to close it.
After that it works fine again. Is it a firewall issue?? It has already been added to the allow rule.

Exception in thread Thread-10:
Traceback (most recent call last):
File “C:\Anaconda3\envs\coralMax\lib\site-packages\requests\”, line 382, in prepare_url
scheme, auth, host, port, path, query, fragment = parse_url(url)
File “C:\Anaconda3\envs\coralMax\lib\site-packages\urllib3\util\”, line 394, in parse_url
return six.raise_from(LocationParseError(source_url), None)
File “”, line 3, in raise_from
urllib3.exceptions.LocationParseError: Failed to parse: http://localhost:None/

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “C:\Anaconda3\envs\coralMax\lib\site-packages\plotly\”, line 1561, in to_image
response = request_image_with_retrying(
File “C:\Anaconda3\envs\coralMax\lib\site-packages\”, line 49, in wrapped_f
return Retrying(*dargs, **dkw).call(f, *args, **kw)
File “C:\Anaconda3\envs\coralMax\lib\site-packages\”, line 212, in call
raise attempt.get()
File “C:\Anaconda3\envs\coralMax\lib\site-packages\”, line 247, in get
six.reraise(self.value[0], self.value[1], self.value[2])
File “C:\Anaconda3\envs\coralMax\lib\site-packages\”, line 703, in reraise
raise value
File “C:\Anaconda3\envs\coralMax\lib\site-packages\”, line 200, in call
attempt = Attempt(fn(*args, **kwargs), attempt_number, False)
File “C:\Anaconda3\envs\coralMax\lib\site-packages\plotly\”, line 1471, in request_image_with_retrying
response = post(server_url + “/”, data=json_str)
File “C:\Anaconda3\envs\coralMax\lib\site-packages\requests\”, line 119, in post
return request(‘post’, url, data=data, json=json, **kwargs)
File “C:\Anaconda3\envs\coralMax\lib\site-packages\requests\”, line 61, in request
return session.request(method=method, url=url, **kwargs)
File “C:\Anaconda3\envs\coralMax\lib\site-packages\requests\”, line 528, in request
prep = self.prepare_request(req)
File “C:\Anaconda3\envs\coralMax\lib\site-packages\requests\”, line 456, in prepare_request
File “C:\Anaconda3\envs\coralMax\lib\site-packages\requests\”, line 316, in prepare
self.prepare_url(url, params)
File “C:\Anaconda3\envs\coralMax\lib\site-packages\requests\”, line 384, in prepare_url
raise InvalidURL(*e.args)
requests.exceptions.InvalidURL: Failed to parse: http://localhost:None/

This is my code

def get_Image(my_lat, my_lon, heading, WP_Info):

WP_lon = []
WP_lat = []
WP_num = tuple(WP_Info.keys()) #way point

for index in WP_num:

fig = go.Figure(go.Scattermapbox(        
    mode = "lines",   #  "markers+lines",
    lon = WP_lon,
    lat = WP_lat,

    opacity = 0.5, 

        color = '#0EFDFE',

    margin ={'l':0,'t':0,'b':0,'r':0},        
    mapbox = {
        'center': {'lon':  my_lon, 'lat': my_lat},
        'style': "white-bg",                                
        'zoom': 20})


img_bytes = fig.to_image(format="png", width=1749, height=966/2, scale=1,engine = 'orca' )

return img_bytes              


:slightly_smiling_face: I found something in the last line.

fig.to_image(format="png", width=1749, height=966/2, scale=1,engine = 'orca' )

if I remove 'engine = ‘orca’ , it work out
but I need ‘orca’ because this is fast