If the chart is not displayed or if you get the following error UserWarning: Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure. There are three other ways you can run Python code within VS Code: Right-click anywhere in the editor window and select Run Python File in Terminal (which saves the file automatically): Select one or more lines, then press Shift+Enter or right-click and select Run Selection/Line in Python Terminal. ![]() Theįollowing command installs matplotlib: sudo apt install python3-matplotlibĬreate and run the following Python script: import matplotlib.pyplot as plt The following occurs when I click on the file in Visual Studio Code and select Run Python File in Terminal (File path names removed) Python Extension Version: 206 Visual Studio Code Version: 1.34. ![]() ![]() ![]() If you work with virtual environments, do not forget to activate your environmentīefore installing matplotlib, otherwise it will be installed system wide.
0 Comments
Leave a Reply. |