### Bug description

I am running quarto via `quarto preview` on the blog containing the jupyter notebooks in environment

```bash
$ cat /etc/os-release
NAME="Ubuntu"
VERSION="21.04 (Hirsute Hippo)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 21.04"
```

The issue is following:

Plotly figures are sometime not rendered properly.

The below is printing the same figures twice. Only the second one is shown

<img width="551" alt="Screen Shot 2022-08-04 at 1 59 04 PM" src="https://user-images.githubusercontent.com/3666080/182951570-bb28d113-a4f9-44b9-92e3-5836ec2f6db7.png">
 
 
 I am doing this with jupyter notebook
 
```
#!/usr/bin/env python
# coding: utf-8
---
title: "2022-08-04--test-jupyter"
author: "My Name"
date: "2022-08-04"
categories:
  - quarto
  - visualization
execute:
  echo: true
format:
  html:
    theme: cyborg
    page-layout: full
    toc: true
    toc-depth: 5
    number-sections: true
    self-contained: true
    smooth-scroll: true
    smooth-scroll: true
    code-line-numbers: true
    #code-fold: true
    #code-tools: false
---
# # Toc

# In[2]:


import plotly.express as px
import plotly


# In[3]:


plotly.offline.init_notebook_mode(connected=True)


# In[4]:


import pandas as pd


# In[5]:


import pandas as pd
df = pd.DataFrame({'a': [1, 2,3]})


# In[6]:


df


# ## Sub Toc

# In[7]:


fig = px.scatter(df, x='a')


# <!-- plotly guard -->
# 
# 
# 
# 
# <!-- yes -->

# In[10]:


fig


# In[11]:


fig


```
 

### `quarto check` Output

```bash
myuser@266e6f1bc382:/org/contributors/myuser/scratch/2022-07-22--quarto-website$ 
myuser@266e6f1bc382:/org/contributors/myuser/scratch/2022-07-22--quarto-website$ quarto check

[✓] Checking Quarto installation......OK
      Version: 1.1.38
      Path: /opt/quarto/bin

[✓] Checking basic markdown render....OK

[✓] Checking Python 3 installation....OK
      Version: 3.9.5
      Path: /usr/bin/python3
      Jupyter: 4.11.1
      Kernels: python3, ir

[✓] Checking Jupyter engine render....OK

[✓] Checking R installation...........OK
      Version: 4.0.4
      Path: /usr/lib/R
      LibPaths:
        - /home/myuser/R/x86_64-pc-linux-gnu-library/4.0
        - /usr/local/lib/R/site-library
        - /usr/lib/R/site-library
        - /usr/lib/R/library
      rmarkdown: 2.6

[✓] Checking Knitr engine render......OK
```

### `quarto tools check` Output

```bash
$ quarto tools check
[✓] Inspecting tools

Tool         Status            Installed     Latest  
chromium     Not installed     ---           869685  
tinytex      Not installed     ---           v2022.08
```

### Checklist

- [X] [formatted your issue](https://yihui.org/issue/#please-format-your-issue-correctly) so it is easier for us to read?
- [X] included a minimal, fully reproducible example in a single .qmd file? Please provide the whole file rather than the snippet you believe is causing the issue.
- [X] documented the quarto version you're running, by pasting the output from running `quarto check` in the "Quarto Check Output" text area?
- [X] documented the version of the quarto tools you're running, by providing the output from running `quarto tools check` in the "Quarto Tools Check Output" text area?
- [X] documented the RStudio IDE version you're running (if applicable), by providing the value displayed in the "About RStudio" main menu dialog?
- [X] documented which operating system you're running? If on Linux, please provide the specific distribution as well.
- [X] upgraded to the latest version, including your versions of R, the RStudio IDE, and relevant R packages?
jjallaire
2022-08-04T21:04:33Z
grepinsight
bug
v1.1
closed
some plotly figures are not rendered (unpredictably)
https://github.com/quarto-dev/quarto-cli/issues/1689