question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Matplotlib Support

See original GitHub issue

Is your feature request related to a problem? Please describe. When I try to use matplotlib with AREPL (which is a great vscode extension, thank you) I have this error thrown up, when it runs fine normally, I have run extensive tests.

TypeError: float() argument must be a string or a number, not '_NoValueType'

Describe the solution you’d like I would like it if this error did not come up, and it just skipped, or even better, that it could show matplotlib graphs inline in the editor.

Describe alternatives you’ve considered

  • Console ASCII graphs
  • Skip error and let rest of code run
Thank you to the AREPL team!

@Almenon @yozlet @coder9604 @caleb15

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:32 (13 by maintainers)

github_iconTop GitHub Comments

4reactions
Almenoncommented, Jul 3, 2021

Sorry about that, arepl doesn’t always work perfectly 😬

Can you post the code that reproduces the error please?

1reaction
Almenoncommented, Jul 26, 2021

Ah, I think I understand the issue now. In hindsight it was fairly obvious what was happening, but the normally the syntax check method is never called so I kinda forgot about it 😅.

Here’s what is happening: AREPL ships with a setting called AREPL.pyGuiLibraries, which is a list of libraries that can create a GUI (a window that pops up). Matplotlib is one of those libraries. Whenever one of those libraries are imported restart mode is activated, where AREPL is restarted every run. This is so the GUI is killed and reloaded when you make code changes. Without restart mode, if you spawned a window, the python process would hang forever until the window was killed.

Before restarting I check the syntax. Unfortunately the syntax check method is using the wrong python path. I need to release a new version of AREPL that fixes this.

In the meantime you can fix it yourself with one of two ways:

  1. If you don’t need restartmode you can change AREPL.pyGuiLibraries to an empty list, so restart mode is never activated.
  2. You can change AREPL’s code to your liking. For example, you can go into C:\<your user>\.vscode\extensions\almenon.arepl-2.0.3\node_modules\python-shell\index.js and change line 236 in checkSyntaxFile to const pythonPath = "py".
Read more comments on GitHub >

github_iconTop Results From Across the Web

Matplotlib — Visualization with Python
Matplotlib is a comprehensive library for creating static, animated, and interactive visualizations in Python. Matplotlib makes easy things easy and hard things ...
Read more >
Matplotlib Pyplot - W3Schools
Pyplot. Most of the Matplotlib utilities lies under the pyplot submodule, and are usually imported under the plt alias: import matplotlib.pyplot as plt....
Read more >
What Is Matplotlib In Python? How to use it for plotting?
Matplotlib is a cross-platform, data visualization and graphical plotting library for Python and its numerical extension NumPy.
Read more >
Scientific mode | PyCharm Documentation - JetBrains
Scientific mode in PyCharm provides support for interactive scientific computing and data ... Plots tab for viewing Matplotlib charts.
Read more >
Matplotlib - Wikipedia
Matplotlib 2.0.x supports Python versions 2.7 through 3.10. Python 3 support started with Matplotlib 1.2. Matplotlib 1.4 is the last version to support...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found