Matplotlib SupportSee 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!
- Created 2 years ago
- Comments:32 (13 by maintainers)
Top GitHub Comments
Sorry about that, arepl doesn’t always work perfectly 😬
Can you post the code that reproduces the error please?
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:
- If you don’t need restartmode you can change AREPL.pyGuiLibraries to an empty list, so restart mode is never activated.
- 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.jsand change line 236 in checkSyntaxFile to
const pythonPath = "py".