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

Plot isn't rendered when using %matplotlib widget #9697

Closed
Mojert opened this issue Apr 17, 2022 · 7 comments
Closed

Plot isn't rendered when using %matplotlib widget #9697

Mojert opened this issue Apr 17, 2022 · 7 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster

Comments

@Mojert
Copy link

Mojert commented Apr 17, 2022

Environment data

  • VS Code version: 1.66.2
  • Jupyter Extension version: v2022.3.1000901801
  • Python Extension version: v2022.4.1
  • OS and version: Linux (Fedora 35 / Kernel 5.16.18-200.fc35.x86_64)
  • Python: 3.10.4
  • Type of virtual environment used: N/A (python packages installed in the home directory)
  • Jupyter server running: Local

Expected behaviour

A plot of the sine function should appear.

Actual behaviour

No plot is produced and a VSCode notification with the following text appears.

Unable to find widget 'jupyter-matplotlib' version '1.0.0' from configured widget sources ["jsdelivr.com","unpkg.com"]. Expected behavior may be affected. Click here for more information.

Steps to reproduce:

  1. Open a new notebook and fill the first cell with this snippet of code:
%matplotlib widget
import matplotlib.pyplot as plt
import numpy as np

X = np.linspace(0, 2*np.pi)
Y = np.sin(X)

fig, ax = plt.subplots()
ax.plot(X, Y)
fig.show()
  1. Run the cell.
  2. Make sure the mimetype of the output cell is set to 'application/vnd.jupyter.widget-view+json'.

Logs

Output for Jupyter in the Output panel

Visual Studio Code (1.66.2, undefined, desktop)
Jupyter Extension Version: 2022.3.1000901801.
Python Extension Version: 2022.4.1.
Workspace folder ~/Documents/Notebooks/Project
Info 10:31:53: ZMQ install verified.
Info 10:31:53: Preferred kernel connection found in cache .jvsc74a57bd0e7370f93d1d0cde622a1f8e1c04877d8463912d04d973331ad4851f04de6915a./bin/python./bin/python.-m#ipykernel_launcher
Info 10:31:53: PreferredConnection: .jvsc74a57bd0e7370f93d1d0cde622a1f8e1c04877d8463912d04d973331ad4851f04de6915a./bin/python./bin/python.-m#ipykernel_launcher found for NotebookDocument: ~/Documents/Notebooks/Project/bug.ipynb
Info 10:31:53: Early registration of controller for Kernel connection .jvsc74a57bd0e7370f93d1d0cde622a1f8e1c04877d8463912d04d973331ad4851f04de6915a./bin/python./bin/python.-m#ipykernel_launcher
Info 10:31:53: TargetController found ID: .jvsc74a57bd0e7370f93d1d0cde622a1f8e1c04877d8463912d04d973331ad4851f04de6915a./bin/python./bin/python.-m#ipykernel_launcher for document ~/Documents/Notebooks/Project/bug.ipynb
Info 10:31:53: Setting controller affinity for ~/Documents/Notebooks/Project/bug.ipynb .jvsc74a57bd0e7370f93d1d0cde622a1f8e1c04877d8463912d04d973331ad4851f04de6915a./bin/python./bin/python.-m#ipykernel_launcher
Info 10:31:53: Getting activation commands for /bin/python are not cached. May take a while.
Info 10:31:53: Experiment status for python is {"enabled":true,"optInto":[],"optOutFrom":[]}
Info 10:31:54: Setting setActiveController for ~/Documents/Notebooks/Project/bug.ipynb
Info 10:31:54: KernelProvider switched kernel to id = .jvsc74a57bd0e7370f93d1d0cde622a1f8e1c04877d8463912d04d973331ad4851f04de6915a./bin/python./bin/python.-m#ipykernel_launcher
Info 10:31:54: Starting Notebook in kernel.ts id = .jvsc74a57bd0e7370f93d1d0cde622a1f8e1c04877d8463912d04d973331ad4851f04de6915a./bin/python./bin/python.-m#ipykernel_launcher for ~/Documents/Notebooks/Project/bug.ipynb
Info 10:31:54: Creating raw notebook for ~/Documents/Notebooks/Project/bug.ipynb
Info 10:31:54: Getting preferred kernel for ~/Documents/Notebooks/Project/bug.ipynb
Info 10:31:54: Computing working directory ~/Documents/Notebooks/Project/bug.ipynb
Info 10:31:54: Creating controller for jupyter-notebook with interpreter /bin/python
Info 10:31:54: Starting raw kernel Python 3.10.4 64-bit for interpreter /bin/python
Info 10:31:54: Kernel launching with ports 9000,9001,9002,9003,9004. Start port is 9000
Info 10:31:54: Process Execution: > /bin/python -m pip list
> /bin/python -m pip list
Info 10:31:54: Process Execution: > /bin/python -c "import ipykernel; print(ipykernel.__version__); print("5dc3a68c-e34e-4080-9c3e-2a532b2ccb4d"); print(ipykernel.__file__)"
> /bin/python -c "import ipykernel; print(ipykernel.__version__); print("5dc3a68c-e34e-4080-9c3e-2a532b2ccb4d"); print(ipykernel.__file__)"
Info 10:31:54: Process Execution: > /bin/python -m ipykernel_launcher --ip=127.0.0.1 --stdin=9003 --control=9001 --hb=9000 --Session.signature_scheme="hmac-sha256" --Session.key=b"9f49a9fe-d4ea-43d2-9f31-2b73d225285b" --shell=9002 --transport="tcp" --iopub=9004 --f=/tmp/tmp-110953SLuqemi57zrY.json
> /bin/python -m ipykernel_launcher --ip=127.0.0.1 --stdin=9003 --control=9001 --hb=9000 --Session.signature_scheme="hmac-sha256" --Session.key=b"9f49a9fe-d4ea-43d2-9f31-2b73d225285b" --shell=9002 --transport="tcp" --iopub=9004 --f=/tmp/tmp-110953SLuqemi57zrY.json
Info 10:31:54: Process Execution: cwd: ~/Documents/Notebooks/Project
cwd: ~/Documents/Notebooks/Project
Info 10:31:55: ipykernel version 6.12.1 for /bin/python
Info 10:31:55: ipykernel location ~/.local/lib/python3.10/site-packages/ipykernel/__init__.py for /bin/python
Info 10:31:55: Registering dummy command feature
Info 10:31:56: Execute Cells request 0
Info 10:31:56: Execute Cell 0 ~/Documents/Notebooks/Project/bug.ipynb
Warn 10:31:57: StdErr from Kernel Process /home/mojert/.local/lib/python3.10/site-packages/traitlets/traitlets.py:2202: FutureWarning: Supporting extra quotes around strings is deprecated in traitlets 5.0. You can use 'hmac-sha256' instead of '"hmac-sha256"' if you require traitlets >=5.
  warn(

Warn 10:31:57: StdErr from Kernel Process /home/mojert/.local/lib/python3.10/site-packages/traitlets/traitlets.py:2157: FutureWarning: Supporting extra quotes around Bytes is deprecated in traitlets 5.0. Use '9f49a9fe-d4ea-43d2-9f31-2b73d225285b' instead of 'b"9f49a9fe-d4ea-43d2-9f31-2b73d225285b"'.
  warn(

Info 10:31:57: Kernel Output: NOTE: When using the `ipython kernel` entry point, Ctrl-C will not work.

To exit, you will have to explicitly quit this process, by either sending
"quit" from a client, or using Ctrl-\ in UNIX-like environments.

To read more about this, see https://github.com/ipython/ipython/issues/2049


To connect another client to this kernel, use:
    --existing /tmp/tmp-110953SLuqemi57zrY.json

Info 10:31:57: Raw session started and connected
Started kernel Python 3.10.4 64-bit
Info 10:31:57: Finished connecting f88ad274-04ce-4013-8a59-1eb36961faa2
Info 10:31:57: UpdateWorkingDirectoryAndPath in Kernel
Info 10:31:57: Executing silently Code (idle) = import site\nsite.addsitedir(site.getusersitepackages())\nimport os\nimport sys\n%cd "/home/mojert/Docum
Info 10:31:57: Executing silently Code (completed) = import site\nsite.addsitedir(site.getusersitepackages())\nimport os\nimport sys\n%cd "/home/mojert/Docum
Info 10:31:57: Waiting for idle on (kernel): 2a3045eb-654b-4cdf-ac84-5967784e770e -> idle
Info 10:31:57: Finished waiting for idle on (kernel): 2a3045eb-654b-4cdf-ac84-5967784e770e -> idle
Info 10:31:59: �[32mFetch Script for {"moduleName":"jupyter-matplotlib","moduleVersion":"1.0.0"}
Info 10:31:59: �[32mFetch Script for jupyter-matplotlib
Info 10:31:59: �[32mSearching for Widget Script jupyter-matplotlib#1.0.0 at path: /home/mojert/.vscode/extensions/ms-toolsai.jupyter-2022.3.1000901801/tmp/scripts/7a8ce27b5d663aa9fab36b9a83e0f31e6d82b113be83ff8be560dfb88a158497/index.js
Info 10:31:59: �[32mWidget Script jupyter-matplotlib#1.0.0 searching
Info 10:31:59: �[32mDownloading from CDN https://cdn.jsdelivr.net/npm/[email protected]/dist/index.js into /tmp/tmp-110953TfMIs2xZm73l.js
Info 10:32:00: �[32mDownloading from CDN https://unpkg.com/[email protected]/dist/index into /tmp/tmp-1109537Af2ZS5fjET0.js
Info 10:32:00: Cell 0 executed with state Success
Info 10:32:00: Error downloading from https://unpkg.com/[email protected]/dist/index:  [a [HTTPError]: Response code 404 (Not Found)
	at EventEmitter.<anonymous> (/home/mojert/.vscode/extensions/ms-toolsai.jupyter-2022.3.1000901801/out/extension.js:2:2539074)
	at EventEmitter.emit (node:events:390:28)
	at /home/mojert/.vscode/extensions/ms-toolsai.jupyter-2022.3.1000901801/out/extension.js:2:2536765
	at Immediate.<anonymous> (/home/mojert/.vscode/extensions/ms-toolsai.jupyter-2022.3.1000901801/out/extension.js:2:2536855)
	at processImmediate (node:internal/timers:464:21)] {
  host: 'unpkg.com',
  hostname: 'unpkg.com',
  method: 'GET',
  path: '/[email protected]/dist/index',
  protocol: 'https:',
  url: 'https://unpkg.com/[email protected]/dist/index',
  statusCode: 404,
  statusMessage: 'Not Found',
  headers: {
    date: 'Sun, 17 Apr 2022 08:32:00 GMT',
    'content-type': 'text/plain; charset=utf-8',
    'transfer-encoding': 'chunked',
    connection: 'close',
    'access-control-allow-origin': '*',
    'content-encoding': 'gzip',
    etag: 'W/"2c-9YhedqwRtN4tGUGTg2Y9M+PMMMI"',
    via: '1.1 fly.io',
    'fly-request-id': '01G0VADQPAAEKGVCN6AMQEPG4R-fra',
    'cf-cache-status': 'EXPIRED',
    'expect-ct': 'max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"',
    vary: 'Accept-Encoding',
    'strict-transport-security': 'max-age=31536000; includeSubDomains; preload',
    'x-content-type-options': 'nosniff',
    server: 'cloudflare',
    'cf-ray': '6fd3cec0ad90233d-ZRH'
  }
}
Info 10:32:00: �[32mDownloading from CDN https://unpkg.com/[email protected]/dist/index into /tmp/tmp-1109537Af2ZS5fjET0.js
Info 10:32:00: Error downloading from https://cdn.jsdelivr.net/npm/[email protected]/dist/index.js:  [a [HTTPError]: Response code 404 (Not Found)
	at EventEmitter.<anonymous> (/home/mojert/.vscode/extensions/ms-toolsai.jupyter-2022.3.1000901801/out/extension.js:2:2539074)
	at EventEmitter.emit (node:events:390:28)
	at /home/mojert/.vscode/extensions/ms-toolsai.jupyter-2022.3.1000901801/out/extension.js:2:2536765
	at Immediate.<anonymous> (/home/mojert/.vscode/extensions/ms-toolsai.jupyter-2022.3.1000901801/out/extension.js:2:2536855)
	at processImmediate (node:internal/timers:464:21)] {
  host: 'cdn.jsdelivr.net',
  hostname: 'cdn.jsdelivr.net',
  method: 'GET',
  path: '/npm/[email protected]/dist/index.js',
  protocol: 'https:',
  url: 'https://cdn.jsdelivr.net/npm/[email protected]/dist/index.js',
  statusCode: 404,
  statusMessage: 'Not Found',
  headers: {
    date: 'Sun, 17 Apr 2022 08:32:00 GMT',
    'content-type': 'text/plain; charset=utf-8',
    'content-length': '67',
    connection: 'close',
    'alt-svc': 'h3=":443"; ma=86400, h3-29=":443"; ma=86400',
    'access-control-allow-origin': '*',
    'access-control-expose-headers': '*',
    'timing-allow-origin': '*',
    'cache-control': 'public, max-age=30, s-maxage=30',
    'cross-origin-resource-policy': 'cross-origin',
    'x-content-type-options': 'nosniff',
    'strict-transport-security': 'max-age=31536000; includeSubDomains; preload',
    etag: 'W/"32-lMx3rUKeIuANT/sXRkkFSpvfrSw"',
    'content-encoding': 'gzip',
    'x-served-by': 'cache-fra19165-FRA',
    'x-cache': 'MISS',
    vary: 'Accept-Encoding',
    'cf-cache-status': 'EXPIRED',
    'expect-ct': 'max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"',
    'report-to': '{"endpoints":[{"url":"https:\\/\\/a.nel.cloudflare.com\\/report\\/v3?s=QLqieztwu83RmYXOZc0SDpNhbMuV%2FXAyElO85zxfIEmLDnB3gfOBRyXjDE%2FTDj3VH%2FuHGxRFXxFXGe2nLcDUHjdzjn2HuVnLv24Aqj5PK0h8SWpMlsJ2EyuF%2BqQ61vEFhJs%3D"}],"group":"cf-nel","max_age":604800}',
    nel: '{"success_fraction":0.01,"report_to":"cf-nel","max_age":604800}',
    server: 'cloudflare',
    'cf-ray': '6fd3cec099c501f4-ZRH'
  }
}
Info 10:32:00: �[32mDownloading from CDN https://cdn.jsdelivr.net/npm/[email protected]/dist/index.js into /tmp/tmp-110953TfMIs2xZm73l.js
Info 10:32:01: Error downloading from https://unpkg.com/[email protected]/dist/index:  [a [HTTPError]: Response code 404 (Not Found)
	at EventEmitter.<anonymous> (/home/mojert/.vscode/extensions/ms-toolsai.jupyter-2022.3.1000901801/out/extension.js:2:2539074)
	at EventEmitter.emit (node:events:390:28)
	at /home/mojert/.vscode/extensions/ms-toolsai.jupyter-2022.3.1000901801/out/extension.js:2:2536765
	at Immediate.<anonymous> (/home/mojert/.vscode/extensions/ms-toolsai.jupyter-2022.3.1000901801/out/extension.js:2:2536855)
	at processImmediate (node:internal/timers:464:21)] {
  host: 'unpkg.com',
  hostname: 'unpkg.com',
  method: 'GET',
  path: '/[email protected]/dist/index',
  protocol: 'https:',
  url: 'https://unpkg.com/[email protected]/dist/index',
  statusCode: 404,
  statusMessage: 'Not Found',
  headers: {
    date: 'Sun, 17 Apr 2022 08:32:01 GMT',
    'content-type': 'text/plain; charset=utf-8',
    'transfer-encoding': 'chunked',
    connection: 'close',
    'access-control-allow-origin': '*',
    'content-encoding': 'gzip',
    etag: 'W/"2c-9YhedqwRtN4tGUGTg2Y9M+PMMMI"',
    via: '1.1 fly.io',
    'fly-request-id': '01G0VADQPAAEKGVCN6AMQEPG4R-fra',
    'cf-cache-status': 'HIT',
    age: '1',
    'expect-ct': 'max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"',
    vary: 'Accept-Encoding',
    'strict-transport-security': 'max-age=31536000; includeSubDomains; preload',
    'x-content-type-options': 'nosniff',
    server: 'cloudflare',
    'cf-ray': '6fd3cec66aa701e7-ZRH'
  }
}
Info 10:32:01: �[32mDownloading from CDN https://unpkg.com/[email protected]/dist/index into /tmp/tmp-1109537Af2ZS5fjET0.js
Info 10:32:01: Error downloading from https://cdn.jsdelivr.net/npm/[email protected]/dist/index.js:  [a [HTTPError]: Response code 404 (Not Found)
	at EventEmitter.<anonymous> (/home/mojert/.vscode/extensions/ms-toolsai.jupyter-2022.3.1000901801/out/extension.js:2:2539074)
	at EventEmitter.emit (node:events:390:28)
	at /home/mojert/.vscode/extensions/ms-toolsai.jupyter-2022.3.1000901801/out/extension.js:2:2536765
	at Immediate.<anonymous> (/home/mojert/.vscode/extensions/ms-toolsai.jupyter-2022.3.1000901801/out/extension.js:2:2536855)
	at processImmediate (node:internal/timers:464:21)] {
  host: 'cdn.jsdelivr.net',
  hostname: 'cdn.jsdelivr.net',
  method: 'GET',
  path: '/npm/[email protected]/dist/index.js',
  protocol: 'https:',
  url: 'https://cdn.jsdelivr.net/npm/[email protected]/dist/index.js',
  statusCode: 404,
  statusMessage: 'Not Found',
  headers: {
    date: 'Sun, 17 Apr 2022 08:32:01 GMT',
    'content-type': 'text/plain; charset=utf-8',
    'content-length': '67',
    connection: 'close',
    'alt-svc': 'h3=":443"; ma=86400, h3-29=":443"; ma=86400',
    'access-control-allow-origin': '*',
    'access-control-expose-headers': '*',
    'timing-allow-origin': '*',
    'cache-control': 'public, max-age=30, s-maxage=30',
    'cross-origin-resource-policy': 'cross-origin',
    'x-content-type-options': 'nosniff',
    'strict-transport-security': 'max-age=31536000; includeSubDomains; preload',
    etag: 'W/"32-lMx3rUKeIuANT/sXRkkFSpvfrSw"',
    'content-encoding': 'gzip',
    age: '1',
    'x-served-by': 'cache-fra19165-FRA',
    'x-cache': 'MISS',
    vary: 'Accept-Encoding',
    'cf-cache-status': 'HIT',
    'expect-ct': 'max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"',
    'report-to': '{"endpoints":[{"url":"https:\\/\\/a.nel.cloudflare.com\\/report\\/v3?s=SFqCMhoDzWeOoHYXG6uj%2Fa%2BrRNwpyR%2F5bWpaaP6IjIReOBKqG2Q%2BiZNZBz6QWt3MQHLo676S6PltCpqa8ktbCnsvosicvfmDCjuwvooEkvKFLuqbIogphhmcep83VZw1Zt4%3D"}],"group":"cf-nel","max_age":604800}',
    nel: '{"success_fraction":0.01,"report_to":"cf-nel","max_age":604800}',
    server: 'cloudflare',
    'cf-ray': '6fd3cec68ed80225-ZRH'
  }
}
Info 10:32:01: �[32mDownloading from CDN https://cdn.jsdelivr.net/npm/[email protected]/dist/index.js into /tmp/tmp-110953TfMIs2xZm73l.js
Info 10:32:01: Error downloading from https://unpkg.com/[email protected]/dist/index:  [a [HTTPError]: Response code 404 (Not Found)
	at EventEmitter.<anonymous> (/home/mojert/.vscode/extensions/ms-toolsai.jupyter-2022.3.1000901801/out/extension.js:2:2539074)
	at EventEmitter.emit (node:events:390:28)
	at /home/mojert/.vscode/extensions/ms-toolsai.jupyter-2022.3.1000901801/out/extension.js:2:2536765
	at Immediate.<anonymous> (/home/mojert/.vscode/extensions/ms-toolsai.jupyter-2022.3.1000901801/out/extension.js:2:2536855)
	at processImmediate (node:internal/timers:464:21)] {
  host: 'unpkg.com',
  hostname: 'unpkg.com',
  method: 'GET',
  path: '/[email protected]/dist/index',
  protocol: 'https:',
  url: 'https://unpkg.com/[email protected]/dist/index',
  statusCode: 404,
  statusMessage: 'Not Found',
  headers: {
    date: 'Sun, 17 Apr 2022 08:32:01 GMT',
    'content-type': 'text/plain; charset=utf-8',
    'transfer-encoding': 'chunked',
    connection: 'close',
    'access-control-allow-origin': '*',
    'content-encoding': 'gzip',
    etag: 'W/"2c-9YhedqwRtN4tGUGTg2Y9M+PMMMI"',
    via: '1.1 fly.io',
    'fly-request-id': '01G0VADQPAAEKGVCN6AMQEPG4R-fra',
    'cf-cache-status': 'HIT',
    age: '1',
    'expect-ct': 'max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"',
    vary: 'Accept-Encoding',
    'strict-transport-security': 'max-age=31536000; includeSubDomains; preload',
    'x-content-type-options': 'nosniff',
    server: 'cloudflare',
    'cf-ray': '6fd3cec6cfa10229-ZRH'
  }
}
Info 10:32:01: �[32mDownloading from CDN https://unpkg.com/[email protected]/dist/index into /tmp/tmp-1109537Af2ZS5fjET0.js
Info 10:32:01: Error downloading from https://cdn.jsdelivr.net/npm/[email protected]/dist/index.js:  [a [HTTPError]: Response code 404 (Not Found)
	at EventEmitter.<anonymous> (/home/mojert/.vscode/extensions/ms-toolsai.jupyter-2022.3.1000901801/out/extension.js:2:2539074)
	at EventEmitter.emit (node:events:390:28)
	at /home/mojert/.vscode/extensions/ms-toolsai.jupyter-2022.3.1000901801/out/extension.js:2:2536765
	at Immediate.<anonymous> (/home/mojert/.vscode/extensions/ms-toolsai.jupyter-2022.3.1000901801/out/extension.js:2:2536855)
	at processImmediate (node:internal/timers:464:21)] {
  host: 'cdn.jsdelivr.net',
  hostname: 'cdn.jsdelivr.net',
  method: 'GET',
  path: '/npm/[email protected]/dist/index.js',
  protocol: 'https:',
  url: 'https://cdn.jsdelivr.net/npm/[email protected]/dist/index.js',
  statusCode: 404,
  statusMessage: 'Not Found',
  headers: {
    date: 'Sun, 17 Apr 2022 08:32:01 GMT',
    'content-type': 'text/plain; charset=utf-8',
    'content-length': '67',
    connection: 'close',
    'alt-svc': 'h3=":443"; ma=86400, h3-29=":443"; ma=86400',
    'access-control-allow-origin': '*',
    'access-control-expose-headers': '*',
    'timing-allow-origin': '*',
    'cache-control': 'public, max-age=30, s-maxage=30',
    'cross-origin-resource-policy': 'cross-origin',
    'x-content-type-options': 'nosniff',
    'strict-transport-security': 'max-age=31536000; includeSubDomains; preload',
    etag: 'W/"32-lMx3rUKeIuANT/sXRkkFSpvfrSw"',
    'content-encoding': 'gzip',
    age: '1',
    'x-served-by': 'cache-fra19165-FRA',
    'x-cache': 'MISS',
    vary: 'Accept-Encoding',
    'cf-cache-status': 'HIT',
    'expect-ct': 'max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"',
    'report-to': '{"endpoints":[{"url":"https:\\/\\/a.nel.cloudflare.com\\/report\\/v3?s=V7DidpqCfCYCFbuBDgjTA1Ugl28lQ4eaUguOK6ULqS91Ba3htDhcUjeEYOgmZlZPlAGweknHwHpDGbgqUFxPT4%2BMh2KI8QZrnali6qYbVlC3fc7kMjNTzh%2BLh1oZxSSWX1A%3D"}],"group":"cf-nel","max_age":604800}',
    nel: '{"success_fraction":0.01,"report_to":"cf-nel","max_age":604800}',
    server: 'cloudflare',
    'cf-ray': '6fd3cec6df420225-ZRH'
  }
}
Info 10:32:01: �[32mDownloading from CDN https://cdn.jsdelivr.net/npm/[email protected]/dist/index.js into /tmp/tmp-110953TfMIs2xZm73l.js
Info 10:32:01: Error downloading from https://unpkg.com/[email protected]/dist/index:  [a [HTTPError]: Response code 404 (Not Found)
	at EventEmitter.<anonymous> (/home/mojert/.vscode/extensions/ms-toolsai.jupyter-2022.3.1000901801/out/extension.js:2:2539074)
	at EventEmitter.emit (node:events:390:28)
	at /home/mojert/.vscode/extensions/ms-toolsai.jupyter-2022.3.1000901801/out/extension.js:2:2536765
	at Immediate.<anonymous> (/home/mojert/.vscode/extensions/ms-toolsai.jupyter-2022.3.1000901801/out/extension.js:2:2536855)
	at processImmediate (node:internal/timers:464:21)] {
  host: 'unpkg.com',
  hostname: 'unpkg.com',
  method: 'GET',
  path: '/[email protected]/dist/index',
  protocol: 'https:',
  url: 'https://unpkg.com/[email protected]/dist/index',
  statusCode: 404,
  statusMessage: 'Not Found',
  headers: {
    date: 'Sun, 17 Apr 2022 08:32:01 GMT',
    'content-type': 'text/plain; charset=utf-8',
    'transfer-encoding': 'chunked',
    connection: 'close',
    'access-control-allow-origin': '*',
    'content-encoding': 'gzip',
    etag: 'W/"2c-9YhedqwRtN4tGUGTg2Y9M+PMMMI"',
    via: '1.1 fly.io',
    'fly-request-id': '01G0VADQPAAEKGVCN6AMQEPG4R-fra',
    'cf-cache-status': 'HIT',
    age: '1',
    'expect-ct': 'max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"',
    vary: 'Accept-Encoding',
    'strict-transport-security': 'max-age=31536000; includeSubDomains; preload',
    'x-content-type-options': 'nosniff',
    server: 'cloudflare',
    'cf-ray': '6fd3cec73a5d01e3-ZRH'
  }
}
Info 10:32:01: �[32mDownloading from CDN https://unpkg.com/[email protected]/dist/index into /tmp/tmp-1109537Af2ZS5fjET0.js
Info 10:32:01: Error downloading from https://cdn.jsdelivr.net/npm/[email protected]/dist/index.js:  [a [HTTPError]: Response code 404 (Not Found)
	at EventEmitter.<anonymous> (/home/mojert/.vscode/extensions/ms-toolsai.jupyter-2022.3.1000901801/out/extension.js:2:2539074)
	at EventEmitter.emit (node:events:390:28)
	at /home/mojert/.vscode/extensions/ms-toolsai.jupyter-2022.3.1000901801/out/extension.js:2:2536765
	at Immediate.<anonymous> (/home/mojert/.vscode/extensions/ms-toolsai.jupyter-2022.3.1000901801/out/extension.js:2:2536855)
	at processImmediate (node:internal/timers:464:21)] {
  host: 'cdn.jsdelivr.net',
  hostname: 'cdn.jsdelivr.net',
  method: 'GET',
  path: '/npm/[email protected]/dist/index.js',
  protocol: 'https:',
  url: 'https://cdn.jsdelivr.net/npm/[email protected]/dist/index.js',
  statusCode: 404,
  statusMessage: 'Not Found',
  headers: {
    date: 'Sun, 17 Apr 2022 08:32:01 GMT',
    'content-type': 'text/plain; charset=utf-8',
    'content-length': '67',
    connection: 'close',
    'alt-svc': 'h3=":443"; ma=86400, h3-29=":443"; ma=86400',
    'access-control-allow-origin': '*',
    'access-control-expose-headers': '*',
    'timing-allow-origin': '*',
    'cache-control': 'public, max-age=30, s-maxage=30',
    'cross-origin-resource-policy': 'cross-origin',
    'x-content-type-options': 'nosniff',
    'strict-transport-security': 'max-age=31536000; includeSubDomains; preload',
    etag: 'W/"32-lMx3rUKeIuANT/sXRkkFSpvfrSw"',
    'content-encoding': 'gzip',
    age: '1',
    'x-served-by': 'cache-fra19165-FRA',
    'x-cache': 'MISS',
    vary: 'Accept-Encoding',
    'cf-cache-status': 'HIT',
    'expect-ct': 'max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"',
    'report-to': '{"endpoints":[{"url":"https:\\/\\/a.nel.cloudflare.com\\/report\\/v3?s=C1t6MOsXXnHH6ddjVKsRby7sNo4EGUVBwiJi88iqaLCRAfYSdQzP6tUrRem9C8clXKDMvs%2BMuary3lzOkjttivd%2BnaimiuF22A9SgCQmzOiKeSatFbCYDDa0bBDCMrtWHgw%3D"}],"group":"cf-nel","max_age":604800}',
    nel: '{"success_fraction":0.01,"report_to":"cf-nel","max_age":604800}',
    server: 'cloudflare',
    'cf-ray': '6fd3cec748c02355-ZRH'
  }
}
Info 10:32:01: �[32mDownloading from CDN https://cdn.jsdelivr.net/npm/[email protected]/dist/index.js into /tmp/tmp-110953TfMIs2xZm73l.js
Info 10:32:01: Error downloading from https://cdn.jsdelivr.net/npm/[email protected]/dist/index.js:  [a [HTTPError]: Response code 404 (Not Found)
	at EventEmitter.<anonymous> (/home/mojert/.vscode/extensions/ms-toolsai.jupyter-2022.3.1000901801/out/extension.js:2:2539074)
	at EventEmitter.emit (node:events:390:28)
	at /home/mojert/.vscode/extensions/ms-toolsai.jupyter-2022.3.1000901801/out/extension.js:2:2536765
	at Immediate.<anonymous> (/home/mojert/.vscode/extensions/ms-toolsai.jupyter-2022.3.1000901801/out/extension.js:2:2536855)
	at processImmediate (node:internal/timers:464:21)] {
  host: 'cdn.jsdelivr.net',
  hostname: 'cdn.jsdelivr.net',
  method: 'GET',
  path: '/npm/[email protected]/dist/index.js',
  protocol: 'https:',
  url: 'https://cdn.jsdelivr.net/npm/[email protected]/dist/index.js',
  statusCode: 404,
  statusMessage: 'Not Found',
  headers: {
    date: 'Sun, 17 Apr 2022 08:32:01 GMT',
    'content-type': 'text/plain; charset=utf-8',
    'content-length': '67',
    connection: 'close',
    'alt-svc': 'h3=":443"; ma=86400, h3-29=":443"; ma=86400',
    'access-control-allow-origin': '*',
    'access-control-expose-headers': '*',
    'timing-allow-origin': '*',
    'cache-control': 'public, max-age=30, s-maxage=30',
    'cross-origin-resource-policy': 'cross-origin',
    'x-content-type-options': 'nosniff',
    'strict-transport-security': 'max-age=31536000; includeSubDomains; preload',
    etag: 'W/"32-lMx3rUKeIuANT/sXRkkFSpvfrSw"',
    'content-encoding': 'gzip',
    age: '1',
    'x-served-by': 'cache-fra19165-FRA',
    'x-cache': 'MISS',
    vary: 'Accept-Encoding',
    'cf-cache-status': 'HIT',
    'expect-ct': 'max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"',
    'report-to': '{"endpoints":[{"url":"https:\\/\\/a.nel.cloudflare.com\\/report\\/v3?s=OfTxJxo7WhwzSP5uRkiqifDVXtoktVvXXylAqEwYzEvPk8ROMLgwBB9OoUmVrh1eLGEq3T6pgw0MpfnrJG3jB8s0%2Bg9oA6ALvqqLcDu%2FtYeYKga6wRd4CWF0bxnqf76Y6Do%3D"}],"group":"cf-nel","max_age":604800}',
    nel: '{"success_fraction":0.01,"report_to":"cf-nel","max_age":604800}',
    server: 'cloudflare',
    'cf-ray': '6fd3cec7bbfccc42-ZRH'
  }
}
Info 10:32:01: Error downloading from https://unpkg.com/[email protected]/dist/index:  [a [HTTPError]: Response code 404 (Not Found)
	at EventEmitter.<anonymous> (/home/mojert/.vscode/extensions/ms-toolsai.jupyter-2022.3.1000901801/out/extension.js:2:2539074)
	at EventEmitter.emit (node:events:390:28)
	at /home/mojert/.vscode/extensions/ms-toolsai.jupyter-2022.3.1000901801/out/extension.js:2:2536765
	at Immediate.<anonymous> (/home/mojert/.vscode/extensions/ms-toolsai.jupyter-2022.3.1000901801/out/extension.js:2:2536855)
	at processImmediate (node:internal/timers:464:21)] {
  host: 'unpkg.com',
  hostname: 'unpkg.com',
  method: 'GET',
  path: '/[email protected]/dist/index',
  protocol: 'https:',
  url: 'https://unpkg.com/[email protected]/dist/index',
  statusCode: 404,
  statusMessage: 'Not Found',
  headers: {
    date: 'Sun, 17 Apr 2022 08:32:01 GMT',
    'content-type': 'text/plain; charset=utf-8',
    'transfer-encoding': 'chunked',
    connection: 'close',
    'access-control-allow-origin': '*',
    'content-encoding': 'gzip',
    etag: 'W/"2c-9YhedqwRtN4tGUGTg2Y9M+PMMMI"',
    via: '1.1 fly.io',
    'fly-request-id': '01G0VADQPAAEKGVCN6AMQEPG4R-fra',
    'cf-cache-status': 'HIT',
    age: '1',
    'expect-ct': 'max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"',
    vary: 'Accept-Encoding',
    'strict-transport-security': 'max-age=31536000; includeSubDomains; preload',
    'x-content-type-options': 'nosniff',
    server: 'cloudflare',
    'cf-ray': '6fd3cec7ad5123df-ZRH'
  }
}
Error 10:32:01: Script source for Widget [email protected] not found
Info 10:32:01: �[32mScript for jupyter-matplotlib, is undefined from undefined
Info 10:32:01: �[32mFetch Script for {"moduleName":"jupyter-matplotlib","moduleVersion":"1.0.0"}
Info 10:32:01: �[32mFetch Script for jupyter-matplotlib
Error 10:32:01: Script source for Widget [email protected] not found
Info 10:32:01: �[32mScript for jupyter-matplotlib, is undefined from undefined
Info 10:32:01: �[32mFetch Script for {"moduleName":"jupyter-matplotlib","moduleVersion":"1.0.0"}
Info 10:32:01: �[32mFetch Script for jupyter-matplotlib
Error 10:32:01: Script source for Widget [email protected] not found
Info 10:32:01: �[32mScript for jupyter-matplotlib, is undefined from undefined
Error 10:32:01: Widget load failure [object Object] {
  className: 'MPLCanvasModel',
  moduleName: 'jupyter-matplotlib',
  moduleVersion: '1.0.0',
  cdnsUsed: false,
  isOnline: true,
  timedout: false,
  error: {}
}
Error 10:32:01: Widget load failure [object Object] {
  className: 'ToolbarModel',
  moduleName: 'jupyter-matplotlib',
  moduleVersion: '1.0.0',
  cdnsUsed: false,
  isOnline: true,
  timedout: false,
  error: {}
}
Error 10:32:01: Widget load failure [object Object] {
  className: 'ToolbarModel',
  moduleName: 'jupyter-matplotlib',
  moduleVersion: '1.0.0',
  cdnsUsed: false,
  isOnline: true,
  timedout: false,
  error: {}
}

@Mojert Mojert added the bug Issue identified by VS Code Team member as probable bug label Apr 17, 2022
@rchiodo rchiodo added info-needed Issue requires more information from poster and removed needs-triage labels Apr 18, 2022
@DonJayamanne
Copy link
Contributor

Thanks for filing this issue.
Please could you list the versions of the packages installed
python -m pip list

@Mojert
Copy link
Author

Mojert commented Apr 19, 2022

Thanks for your answer !
Yes, sure:

Package              Version
-------------------- --------
anyio                3.5.0
argcomplete          1.12.3
argon2-cffi          21.3.0
argon2-cffi-bindings 21.2.0
asttokens            2.0.5
attrs                21.4.0
Babel                2.9.1
backcall             0.2.0
Beaker               1.10.0
beautifulsoup4       4.9.3
bleach               5.0.0
blivet               3.4.3
blivet-gui           2.3.0
Brlapi               0.8.2
cffi                 1.15.0
chardet              4.0.0
charset-normalizer   2.0.4
chrome-gnome-shell   0.0.0
click                8.0.1
cryptography         3.4.7
cupshelpers          1.0
cycler               0.11.0
dasbus               1.6
dbus-python          1.2.18
debugpy              1.6.0
decorator            5.1.1
defusedxml           0.7.1
distro               1.6.0
entrypoints          0.4
et-xmlfile           1.1.0
executing            0.8.3
fastjsonschema       2.15.3
fedora-third-party   0.8
fonttools            4.32.0
fros                 1.1
gpg                  1.15.1
humanize             0.5.1
idna                 3.2
ipykernel            6.12.1
ipympl               0.9.0
ipython              8.2.0
ipython-genutils     0.2.0
ipywidgets           7.7.0
jedi                 0.18.1
Jinja2               3.1.1
json5                0.9.6
jsonschema           4.4.0
jupyter-client       7.2.2
jupyter-core         4.9.2
jupyter-server       1.16.0
jupyterlab           3.3.3
jupyterlab-pygments  0.2.0
jupyterlab-server    2.12.0
jupyterlab-widgets   1.1.0
kiwisolver           1.4.2
langtable            0.0.57
libcomps             0.1.18
lxml                 4.6.5
Mako                 1.1.4
MarkupSafe           2.0.0
matplotlib           3.5.1
matplotlib-inline    0.1.3
mistune              0.8.4
mpmath               1.2.1
nbclassic            0.3.7
nbclient             0.5.13
nbconvert            6.4.5
nbformat             5.3.0
nest-asyncio         1.5.5
nftables             0.1
notebook             6.4.10
notebook-shim        0.1.0
numpy                1.22.3
olefile              0.46
openpyxl             3.0.9
packaging            21.3
pandas               1.4.2
pandocfilters        1.5.0
parso                0.8.3
Paste                3.5.0
pexpect              4.8.0
pickleshare          0.7.5
pid                  2.2.3
Pillow               8.3.2
pip                  21.2.3
ply                  3.11
productmd            1.33
prometheus-client    0.14.1
prompt-toolkit       3.0.29
psutil               5.9.0
ptyprocess           0.6.0
pure-eval            0.2.2
pwquality            1.4.4
pycairo              1.20.1
pycparser            2.20
pycrypto             2.6.1
pycups               2.0.1
pycurl               7.44.1
pyenchant            3.2.2
Pygments             2.11.2
PyGObject            3.42.0
pykickstart          3.34
pyOpenSSL            21.0.0
pyparsing            2.4.7
pyparted             3.12.0
pyrsistent           0.18.1
PySocks              1.7.1
python-augeas        1.1.0
python-dateutil      2.8.2
python-meh           0.50
pytz                 2022.1
pyudev               0.22.0
pyxdg                0.27
pyzmq                22.3.0
regex                2022.3.2
requests             2.27.0
requests-file        1.5.1
requests-ftp         0.3.1
rpm                  4.17.0
scipy                1.8.0
selinux              3.3
Send2Trash           1.8.0
sepolicy             3.3
setools              4.4.0
setuptools           57.4.0
simpleaudio          1.0.4
simpleline           1.8.2
six                  1.16.0
sniffio              1.2.0
sos                  4.2
soupsieve            2.3.1
stack-data           0.2.0
sympy                1.10.1
systemd-python       234
Tempita              0.5.2
terminado            0.13.3
testpath             0.6.0
tornado              6.1
traitlets            5.1.1
urllib3              1.26.7
wcwidth              0.2.5
webencodings         0.5.1
websocket-client     1.3.2
widgetsnbextension   3.6.0
xlrd                 2.0.1

@FabianGD
Copy link

I experience the same bug after updating ipympl to 0.9.0. It seems that it's related to matplotlib/ipympl#463 as the most up-to-date version of jupyter-matplotlib on npm is 0.11.0 and not 1.0.0.

Output of `python3 -m pip list` ``` aiodns 3.0.0 aiohttp 3.8.1 aiohttp-cors 0.7.0 aiosignal 1.2.0 anyio 3.5.0 argon2-cffi 21.3.0 argon2-cffi-bindings 21.2.0 astroid 2.9.3 asttokens 2.0.5 async-generator 1.10 async-timeout 4.0.2 attrs 21.4.0 Babel 2.9.1 backcall 0.2.0 black 22.1.0 bleach 4.1.0 Brotli 1.0.9 brotlicffi 1.0.9.2 cchardet 2.1.7 certifi 2021.10.8 cffi 1.15.0 chardet 4.0.0 charset-normalizer 2.0.12 click 8.0.4 colorama 0.4.4 curio 1.5 cycler 0.11.0 decorator 5.1.1 defusedxml 0.7.1 docutils 0.17.1 entrypoints 0.4 eQD 0.3.0 executing 0.8.2 fonttools 4.29.1 frozenlist 1.3.0 h5py 3.6.0 html5lib 1.1 idna 3.3 importlib-metadata 4.11.2 ipykernel 6.9.1 ipympl 0.9.0 ipython 8.1.0 ipython-genutils 0.2.0 ipywidgets 7.6.5 isort 5.10.1 jedi 0.18.1 Jinja2 3.0.3 joblib 1.1.0 json5 0.8.5 jsonschema 4.4.0 jupyter-client 7.1.2 jupyter-core 4.9.2 jupyter-server 1.11.2 jupyterlab 3.3.4 jupyterlab-pygments 0.1.2 jupyterlab-server 2.10.3 jupyterlab-widgets 2.0.0b1 kiwisolver 1.3.2 lazy-object-proxy 1.7.1 llvmlite 0.38.0 lz4 4.0.0 MarkupSafe 2.1.0 matplotlib 3.5.1 matplotlib-inline 0.1.3 mccabe 0.6.1 mistune 0.8.4 mock 4.0.3 more-itertools 8.12.0 mpmath 1.2.1 multidict 6.0.2 mypy-extensions 0.4.3 nbclassic 0.3.5 nbclient 0.5.11 nbconvert 6.4.2 nbformat 5.1.3 nbstripout 0.5.0 nest-asyncio 1.5.4 notebook 6.4.8 numba 0.55.1 numpy 1.21.5 olefile 0.46 opt-einsum 3.3.0 outcome 1.1.0 packaging 21.3 pandocfilters 1.5.0 parso 0.8.3 path.py 12.0.1 pathspec 0.9.0 pbr 5.8.1 pexpect 4.8.0 pickleshare 0.7.5 Pillow 9.0.1 pip 22.0.3 platformdirs 2.5.1 prometheus-client 0.13.1 prompt-toolkit 3.0.28 ptyprocess 0.7.0 pure-eval 0.2.1 py 1.11.0 pycares 4.1.2 pycparser 2.21 Pygments 2.11.2 pylint 2.12.2 pyparsing 3.0.7 pyrsistent 0.18.1 PySocks 1.7.1 python-dateutil 2.8.2 python-socks 2.0.3 pytz 2021.3 PyYAML 6.0 pyzmq 22.3.0 qdplot 0.0.1 requests 2.27.1 requests-unixsocket 0.3.0 scipy 1.8.0 Send2Trash 1.8.1b0 setuptools 60.8.2.post0 six 1.16.0 sniffio 1.2.0 sortedcontainers 2.4.0 stack-data 0.2.0 sympy 1.9 terminado 0.13.1 testpath 0.6.0 toml 0.10.2 tomli 2.0.1 tornado 6.1 tqdm 4.63.0 traitlets 5.1.1 trio 0.20.0 typing_extensions 4.1.1 urllib3 1.26.8 uvloop 0.16.0 wcwidth 0.2.5 webencodings 0.5.1 websocket-client 1.3.1 widgetsnbextension 3.5.2 wrapt 1.13.3 yarl 1.7.2 zipp 3.7.0 ```

@martinRenou
Copy link

This issue should be resolved with ipympl 0.9.1. Please try to upgrade (pypi package available now, conda-forge package should be available in ~1 hour).

@Mojert
Copy link
Author

Mojert commented Apr 25, 2022

I updated ipympl to 0.9.1 and it now kind of works. Thank you everyone !

However it now shows twice like so:
image

When I comment out fig.show() I now only have 1 plot but also what I assume is the repr() of the Line2D object I've just plotted. The screenshot:
image

To get rid of the repr() string I had to discard the return value of the plot method like this: _ = ax.plot(X, Y)

Is this expected behavior ? If yes, is it possible to only show the figure and not the repr string without using what feels to me like a dirty hack. If no should I create a new issue ?

@martinRenou
Copy link

This is the expected behavior, it behaves like the inline backend does in Jupyter. plt.plot(X, Y) shows the figure once, plt.show() shows it a second time.

If you don't want to see the text repr, you can add a ; at the end of your cell (works on Jupyter Notebook and JupyterLab but I have not tested it in vscode):

%matplotlib widget
import matplotlib.pyplot as plt
import numpy as np

fig = plt.figure()
plt.plot(np.sin(np.linspace(0, 20, 100)));

@Mojert
Copy link
Author

Mojert commented Apr 25, 2022

It also works in vscode (I have just tested it).

This solves my issue, thank you very much !

@Mojert Mojert closed this as completed Apr 25, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

5 participants