Installing Matplotlib in Visual Studio Code

Поделиться
HTML-код
  • Опубликовано: 18 сен 2024
  • In this video tutorial, we will learn to use "matplotlib" and "numpy" packages to create a graphical plot as is commonly done with data science.
    Step 1: Create a file with the name: firstplot.py
    ******************************************
    import matplotlib.pyplot as plt
    import numpy as np
    x = np.linspace(0, 20, 100)
    plt.plot(x, np.sin(x))
    plt.show()
    *******************************************
    Now run the file in the debugger using the "Python: Current file"
    you would see a message, "ModuleNotFoundError: No module named 'matplotlib'". Such a message indicates that the required package isn't available in your system.
    Step 2: 'matplotlib' package installation (which also installs numpy as a dependency):
    open Command Palette to run Terminal: Create New Integrated Terminal (Ctrl+Shift+`).
    Note: We will create a virtual environment and install the required packages, Such isolation reduces many complications that can arise from conflicting package versions.
    **Enter the following command:
    py -3 -m venv .venv
    .venv\scripts\activate
    Important:
    ***********
    If the activate command generates the message "Activate.ps1 is not digitally signed. You cannot run this script on the current system.", then you need to temporarily change the PowerShell execution policy to allow scripts to run.
    Set -ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope Process
    Step 3: Select your new environment by using the Python: Select Interpreter command from the Command Palette.
    Run the following command:
    python -m pip install matplotlib
    Step 4: Deactivate environment:
    Once you are finished,
    type "deactivate" in the terminal window to deactivate the virtual environment.
    If you found this video tutorial useful and would like to support me, you can do so by buying me a coffee using the below link!
    buymeacoffee.c...
    ***Other Best VS Code Tutorial by Cool IT Help****
    - Seaborn setup in Visual Studio Code
    • Seaborn setup in Visua...
    - How to create a Maven Based Web Project in Visual Studio code? | Maven Setup VS Code
    • How to create a Maven ...
    - Apache Tomcat 9.0 Setup and Web Project Deployment in Visual Studio code
    • Apache Tomcat 9.0 Setu...
    - Using SonarLint in Visual Studio Code
    • Using SonarLint in Vis...
    - Installing Matplotlib in Visual Studio Code
    • Installing Matplotlib ...
    - Configure and Run Debugger on Python program in Visual Studio Code | Beginner's Tutorial
    • Configure and Run Debu...
    - Setting up Python Development Environment in Visual Studio Code | Tutorial for Beginners
    • Setting up Python Deve...
    - How to connect SQLite database with Visual Studio Code?
    • How to connect SQLite ...
    - Running a java program in Visual Studio Code on Mac OS X Catalina | Java Setup VS Code
    • Running a java program...
    - Running C/C++ program in Visual Studio Code on Mac OS X Catalina
    • Running C/C++ program...
    - How to run C and C++ programs in Visual Studio Code (Windows 10)?
    • How to run C and C++ p...
    - Regex Previewer | Useful Extension for Visual Studio Code for live testing your regular expressions.
    • Regex Previewer | Usef...
    - How to completely uninstall Visual Studio Code from windows?
    • How to completely unin...
    - How to setup JavaFX Environment in Visual Studio Code?
    • How to setup JavaFX En...
    - How to run a java program in visual studio code? | Java setup in VS code
    • How to run java progra...
    #MatplotlibVScode #CoolITHelp

Комментарии • 50

  • @thatskyplayer
    @thatskyplayer Год назад +4

    I'm a computer science student and I can say this is highly effective. It took me approx. 30 min for me to figure out how to solve "You cannot run this script on the current system" error though. Thanks a million.

    • @Bagnesium
      @Bagnesium 6 месяцев назад

      why did you comment?

  • @adamclarke403
    @adamclarke403 2 года назад +9

    Have been pulling out my hair for the past 30 minutes trying to figure this out. Thank you so much, have a glorious day my friend!

  • @efecantepe3990
    @efecantepe3990 2 года назад +4

    I am a computer science student and I decided to use matplotlib for my homework. first time in the history of my education. I made the configuration of my setup less than 10 minutes. thank you.

  • @Aeorith
    @Aeorith 3 года назад +2

    Thank you so much for this tutorial! I postponed installing matplotlib for such a long time, cause I didn't find a proper tutorial, but with this it was really easy! :D

  • @ChequeWriter
    @ChequeWriter 9 месяцев назад

    "This is looking nice" - enough said!

  • @advancegamer8599
    @advancegamer8599 3 года назад +8

    After doing all steps it still shows module not found what to do ??

  • @anton.mikheyev
    @anton.mikheyev 2 года назад

    i didnt understand what i did , but it works, thank you

  • @emmak9090
    @emmak9090 2 года назад +1

    Super helpful, thank you so much

  • @TippsausEuropa
    @TippsausEuropa Год назад

    nice bro. best regards from Berlin

  • @alyanrs
    @alyanrs 2 года назад +1

    thank you so much! it helps me a lot.

  • @udyanabha1908
    @udyanabha1908 Год назад

    I really appreciate your help, man
    I really appreciate your help, man
    I really appreciate your help, man

  • @sakshishrivastava0210
    @sakshishrivastava0210 3 года назад +2

    Thanks a lot☺❤

  • @jassonmatias7783
    @jassonmatias7783 3 года назад +1

    Perfect! Thank you!!!

  • @dankoyy42
    @dankoyy42 3 года назад +1

    thanks, god bless!

  • @riccoc.6507
    @riccoc.6507 8 месяцев назад

    OK genius ty bro.

  • @steev708
    @steev708 Год назад

    Ayy thanks mate.

  • @مزيجرياضي
    @مزيجرياضي 2 года назад

    thank you so much for every thing

  • @alexandro_coutinho
    @alexandro_coutinho 6 месяцев назад

    Thank you sir!

  • @baptistearnaudo8699
    @baptistearnaudo8699 2 года назад

    thank you sir you really are a tremendous help !

  • @承鈞-q5h
    @承鈞-q5h 2 года назад +1

    Why I need to creat a virtual environment? What is the different between with no virtual environment?

  • @necromancer7712
    @necromancer7712 Год назад

    thank you so much,. really helpful

  • @Besu195
    @Besu195 4 месяца назад

    very very tnx

  • @rabbitazteca23
    @rabbitazteca23 3 года назад +1

    hi there isn't any item in my "Scripts" folder called 'activate'

  • @cheninisolaf._.8787
    @cheninisolaf._.8787 10 месяцев назад

    Big thanks legend

  • @sharongutierrezchele8969
    @sharongutierrezchele8969 Год назад

    Muchas gracias!!!

  • @samiabdullah6116
    @samiabdullah6116 3 года назад

    Thanks a lot, buddy.................

  • @oscar.kiamba
    @oscar.kiamba Год назад

    hello I have this error once i try to run my code.
    DLL load failed while importing _path: The specified module could not be found.
    PS C:\Users\user\Documents>

  • @arielangulobascunan2679
    @arielangulobascunan2679 2 года назад

    thank you, very helpfull!

  • @lokenathmukherjeekol
    @lokenathmukherjeekol Месяц назад

    "WARNING: Failed to activate VS environment: Could not parse vswhere.exe output" - how to bypass this ?

  • @yudistirarakacendikia6820
    @yudistirarakacendikia6820 3 года назад

    thank you!! help me a lot

  • @fferro8907
    @fferro8907 3 года назад

    Thank you!

  • @PipeJM117
    @PipeJM117 Год назад

    Hey, good video.

  • @vikashKumar-rj5ou
    @vikashKumar-rj5ou 2 года назад

    Thanks bro 🤜

  • @ТатьянаДударева-б9ф

    Thank you!

  • @israelramirez8643
    @israelramirez8643 3 года назад

    thank you man!

  • @VikasRaj_Hyd
    @VikasRaj_Hyd Год назад

    What if I don't create a virtual environment for this ?

  • @lukassemrau1726
    @lukassemrau1726 3 года назад +1

    I have an error: import matplotlib.pyplot as plt
    IndentationError: unexpected indent
    What should i do

    • @prashilthul6579
      @prashilthul6579 3 года назад +3

      hey bro plz share your code with me i can try to resolve it but most probably its just a error of indentation (you might have not given proper spaces/tabs so plz do check it)

  • @juansebastiancasalinsoreju8205
    @juansebastiancasalinsoreju8205 2 года назад

    Godlike

  • @faiqhilman4300
    @faiqhilman4300 Год назад

    how do i change the powershell script policy???

  • @rojadsorum9515
    @rojadsorum9515 2 года назад

    venev is not activated in the system what to do

  • @Supercool7042
    @Supercool7042 2 года назад

    why the fuck it is still not installing in my computer
    i did this 3-4 times but still not.
    everything is working fine but when run this 'python -m pip install matplotlib ' it gives error😤😤😤😤😤😤

  • @isabellanamuddu9639
    @isabellanamuddu9639 3 года назад +1

    I cant find the virtual environment i just created

    • @Aeorith
      @Aeorith 3 года назад +1

      I had the same issue, restarting VS Code helped. Once I open VS Code again, simply do the .venv\scripts\activate command again, and then you can choose the virtual environment as interpreter :)

  • @rojadsorum9515
    @rojadsorum9515 2 года назад

    pip is not module

  • @candy7333
    @candy7333 2 года назад

    sadly, error happends

  • @BarakaGitari
    @BarakaGitari Год назад

    thank you!