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

Cannot save plots generated in Interactive Window as PDF #2936

Closed
smithalexk opened this issue Oct 10, 2019 · 2 comments
Closed

Cannot save plots generated in Interactive Window as PDF #2936

smithalexk opened this issue Oct 10, 2019 · 2 comments
Assignees

Comments

@smithalexk
Copy link

Bug: Notebook Editor, Interactive Window, Python Editor cells

When I try to save a figure generated using the Interactive window (e.g. using matplotlib), I cannot save the data as a PDF. Instead, I get the following error:

Error

When I save as a PNG or SVG, the image saves properly.

Steps to cause the bug to occur

  1. Run the following code snippet:
#%%
import matplotlib.pyplot as plt
import numpy as np

xx = np.linspace(0, 3*np.pi,50)
yy = np.sin(xx)
plt.plot(xx,yy)
  1. Open the plot in the "Plots" tab

  2. Choose to save the plot as a PDF.

Actual & Expected behavior

Expected behaviour: Saves image as PDF.

Actual behaviour: Receive TypeError

Your Jupyter and/or Python environment

Please provide as much info as you readily know

  • Jupyter server running: Local
  • Extension version: 2019.10.41019
  • VS Code version: 1.39
  • Setting python.jediEnabled: true
  • Python and/or Anaconda version: Python: 3.7.4/Conda: 4.6.14
  • OS: Mac (Mojave)
  • Virtual environment: conda

Developer Tools Console Output

[Extension Host] Info Python Extension: 2019-10-10 16:18:52: exporting plot...
console.ts:137 [Extension Host] Info Python Extension: 2019-10-10 16:18:54: Attempting pdf write...
console.ts:137 [Extension Host] Error Python Extension: 2019-10-10 16:18:54: [TypeError: n(...) is not a constructor	at Object.exportPlot (/Users/asmith/.vscode/extensions/ms-python.python-2019.10.41019/out/client/extension.js:75:1128674)]
t.log @ console.ts:137
$logExtensionHostMessage @ mainThreadConsole.ts:39
_doInvokeHandler @ rpcProtocol.ts:398
_invokeHandler @ rpcProtocol.ts:383
_receiveRequest @ rpcProtocol.ts:299
_receiveOneMessage @ rpcProtocol.ts:226
_protocol.onMessage.e @ rpcProtocol.ts:101
fire @ event.ts:580
fire @ ipc.net.ts:453
_receiveMessage @ ipc.net.ts:733
_socketDisposables.push._socketReader.onMessage.e @ ipc.net.ts:592
fire @ event.ts:580
acceptChunk @ ipc.net.ts:239
_register._socket.onData.e @ ipc.net.ts:200
t @ ipc.net.ts:28
emit @ events.js:182
addChunk @ _stream_readable.js:283
readableAddChunk @ _stream_readable.js:264
Readable.push @ _stream_readable.js:219
onStreamRead @ internal/stream_base_commons.js:94
notificationsAlerts.ts:40 Error exporting image: TypeError: n(...) is not a constructor
onDidNotificationChange @ notificationsAlerts.ts:40
_register.model.onDidNotificationChange.e @ notificationsAlerts.ts:26
fire @ event.ts:580
addNotification @ notifications.ts:156
notify @ notificationService.ts:100
r @ mainThreadMessageService.ts:83
_showMessage @ mainThreadMessageService.ts:44
$showMessage @ mainThreadMessageService.ts:38
_doInvokeHandler @ rpcProtocol.ts:398
_invokeHandler @ rpcProtocol.ts:383
_receiveRequest @ rpcProtocol.ts:299
_receiveOneMessage @ rpcProtocol.ts:226
_protocol.onMessage.e @ rpcProtocol.ts:101
fire @ event.ts:580
fire @ ipc.net.ts:453
_receiveMessage @ ipc.net.ts:733
_socketDisposables.push._socketReader.onMessage.e @ ipc.net.ts:592
fire @ event.ts:580
acceptChunk @ ipc.net.ts:239
_register._socket.onData.e @ ipc.net.ts:200
t @ ipc.net.ts:28
emit @ events.js:182
addChunk @ _stream_readable.js:283
readableAddChunk @ _stream_readable.js:264
Readable.push @ _stream_readable.js:219
onStreamRead @ internal/stream_base_commons.js:94
@rchiodo
Copy link
Contributor

rchiodo commented Oct 10, 2019

I get this error:
Error exporting image: Error: ENOENT: no such file or directory, open 'c:\Users\rchiodo.REDMOND.vscode\extensions\ms-python.python-2019.11.41015-dev\out\client\node_modules/data.trie'

Looks like something messed up our webpacking.

@DonJayamanne DonJayamanne self-assigned this Oct 14, 2019
@rchiodo
Copy link
Contributor

rchiodo commented Oct 15, 2019

Validated

@rchiodo rchiodo closed this as completed Oct 15, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 22, 2019
@microsoft microsoft unlocked this conversation Nov 14, 2020
@DonJayamanne DonJayamanne transferred this issue from microsoft/vscode-python Nov 14, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants