Setting Up VSCode For Python Programming

Поделиться
HTML-код
  • Опубликовано: 21 дек 2024

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

  • @TraversyMedia
    @TraversyMedia  4 года назад +115

    Happy Friday everybody. I wanted to do something simple today and just show you my setup for vsc/python. This assumes you have Python already installed. Have a great weekend!

    • @SahraClayton
      @SahraClayton 4 года назад +1

      hi Brad, I sent you an email to the address linked to your youtube. Could you please read it and give me a little advice. I would post it here but there is some private stuff in there

    • @bhanukumar2165
      @bhanukumar2165 4 года назад

      Please make adavance mongodb ,udemy course,
      It's more helpful

    • @TraversyMedia
      @TraversyMedia  4 года назад +3

      Hollywood BS ill check. Im not ignoring you, I have a jam packed inbox

    • @SahraClayton
      @SahraClayton 4 года назад +1

      @@TraversyMedia Thank you

    • @lordswaggity1213
      @lordswaggity1213 4 года назад

      @@TraversyMedia Wow very helpful. 👌

  • @CDitfort
    @CDitfort 4 года назад +304

    For those using windows :
    Creating a virtual environment
    py -3 -m venv venv
    Activating virtual environment
    venv\Scripts\activate
    De-activating virtual environment
    deactivate
    Also if you have problems activating the virtual environment. Run Windows PowerShell in Administrator and run
    Set-ExecutionPolicy -ExecutionPolicy Unrestricted

    • @elioabihabib2498
      @elioabihabib2498 4 года назад

      '.' is not recognized as an internal or external command,
      operable program or batch file. is what I'm getting when I run the command to activate the virtual environment

    • @shazam314
      @shazam314 4 года назад

      @@elioabihabib2498 use backslash

    • @elioabihabib2498
      @elioabihabib2498 4 года назад

      @@shazam314 in place of the '.'

    • @shazam314
      @shazam314 4 года назад

      @@elioabihabib2498 changing / to \ didn't solve the issue?

    • @elioabihabib2498
      @elioabihabib2498 4 года назад

      @@shazam314 I was asking where to put the backslash.

  • @JasperGom
    @JasperGom 3 года назад +4

    Dude, thank you SO MUCH! This video was exactly what I needed. At work I'm learning to code in Python, but the whole env is already set-up (with pytest, flake8, kite, ...) No one could show me how to set up a similar environment on my personal machine. Over the last few hours I've tried PyCharm (horrible to set up!), IDLE, ... the works, but to no avail. Then I found this video, and it fits my situation 100%. Again, so damn grateful! Instant sub :-)

  • @MarcMcRae
    @MarcMcRae 4 года назад

    "Old-noob" (some studies 20 yrs ago, Borland c) old hand@Linux, so this IDE/NOTIDE but very advanced non-terminal text editor, VSCode + plugins gig opened up a new world..bloody amazing - your video shared SO much cool stuff! Beginning Python now..

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

    Why did i wait 12 months after starting to code to watch this!! *sobbing in the corner.....* GAME CHANGER !!!!

  • @lil-mi-777
    @lil-mi-777 4 года назад +10

    This is the best introduction on vscode setup for Python that I can find :) Thank you for the good work!

  • @techlead...
    @techlead... 4 года назад +6

    No joke
    I was unable to run .py file today and you upload this one.
    Thanks a million Brad

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

    I found it's Brad without even checking the channel name. This is the first time I visit his channel. Effect of Udemy.. Great lecturer.

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

    I always see comments like ' I was just searching for this' but I was LITERALLY just searching for this, just out of curiosity and you have a new vid on it.
    Amazing

  • @altughanozengi9498
    @altughanozengi9498 4 года назад +31

    The moment you smile when RUclips notifies there is a new video from Traversy Media 🤜

  • @vishwanath-ts
    @vishwanath-ts 4 года назад +6

    Brad thank you so much for making this video I didn't have any idea how to use debugger thanks for teaching me how to use debugger and AREPL extension is really cool saves lots of time!!

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

    after many many many hours and re-installs of crap vs code libraries I'm finally able to use my virtual environment. Thank you!

  • @kvncnls
    @kvncnls 4 года назад

    I am LITERALLY just getting back into Python after a long break from it and just setting it up on my new laptop. You're the best!

  • @jenglish1986
    @jenglish1986 10 месяцев назад

    Good set up of code. Amazing how there are so many of these vids and your the only one who has a complete set up - go figure 😊

  • @reactdev-fs9be
    @reactdev-fs9be 4 года назад +1

    This video is perfect timing. I'm starting Python on Monday at my code bootcamp. Thanks Brad!

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

    Excellent video. Added some to my mediocre VSC skills. At this date, however, Kite seems to be off-line and Python Snippets behave oddly. Not complaining. Very much worth the time. Thank you.

  • @EfrainValles
    @EfrainValles 4 года назад +1

    This is a cool video, interesting how no matter how simple and intuitive there will always something to fix.

  • @wadergu
    @wadergu 3 года назад +7

    Can I ask a question. Why didn't I get a snippets in the prompt when I type. Thank you, Sir

  • @parfumasilo8968
    @parfumasilo8968 4 года назад +32

    The term 'python' is not recognized as the name.......
    For those of you that have this error.
    instead of typing "python -m venv venv" you replace the python word to just py
    "py -m venv venv"

    • @mattarcher6119
      @mattarcher6119 4 года назад

      worked for me

    • @rafaelfernandez725
      @rafaelfernandez725 4 года назад

      Thanks, you helped me get through that hurdle. Now however, the source command for venv activate is not working for me

    • @mattarcher6119
      @mattarcher6119 4 года назад

      @@rafaelfernandez725 maybe manually create a venv folder in your python projects folder(im new, i could be wrong.)

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

    Thank you, I'm just starting to learn python and I have no clue how to use any coding programs so this was helpful.

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

    Just found this page, thank you for the setup tut in VSC! Really helped me a lot as a newcomer to python

  • @automationtesting3149
    @automationtesting3149 4 года назад

    This is the first time I am learning Python and it is really helpful

  • @mahdou3608
    @mahdou3608 3 года назад +4

    2:56 can't find snippets

  • @gbeedafaloom4969
    @gbeedafaloom4969 4 года назад

    OMG, who is this guy? THANK YOU SO MUCH for making this soooooo easy for me!!

  • @victorbjorklund
    @victorbjorklund 4 года назад +22

    Damn. You read my mind. Today I was thinking: Hmm i need to figure out how to code python on VSCODE.

  • @danimvijay3089
    @danimvijay3089 4 года назад +11

    I was about to start with python, and suddenly out of nowhere, this video! This is giving me a head start for sure. Liked the fact that you've included testing also.
    Can you make a video on unit testing with react? Jest/enzyme, react testing library or whatever you prefer.

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

    Loved the AREPL!
    Thanks Brad

  • @eniolaajayi398
    @eniolaajayi398 4 года назад

    Mr Traversy you are a lifesaver. I really needed this!

  • @lathryx
    @lathryx 4 года назад +1

    For those of you following along with the exact code here, I typed out the contents of the JSON Array from the beginning (here):
    [{"id":1, "text": "Item 1"}, {"id":2, "text": "Item 2"}]

  • @djs1258
    @djs1258 4 года назад

    exactly, the video i was searching and u made it..Was actually searching your previous videos to c if there is any new one with Python and VScode.. I see it now

  • @lordswaggity1213
    @lordswaggity1213 4 года назад +139

    Brad has traversed so many arrays he became Traversy 😛🙃

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

    If you are using windows and you ran the command in the terminal and get the error "cannot be
    loaded because running scripts is disabled on this system", I recommend doing the following (it worked for me):
    1. Run Windows Powershell
    2. Run command Get-ExecutionPolicy -List to see if you have CurrentUser and/or LocalMachine as "restricted". (This prevents the running of scripts).
    3. Change CurrentUser to RemoteSigned by running command: Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser. Press Enter and type 'Y' for Yes
    4. Change LocalMachine to AllSigned: Set-ExecutionPolicy -ExecutionPolicy AllSigned -Scope LocalMachine
    5. Run Get-ExecutionPolicy -List again to ensure they are reset.
    It should work now when you enter py -3 -m venv venv and venv\Scripts\activate in VS terminal. 😄
    Go to Microsoft and search "about_Execution_Policies" for more instructions

  • @sarabattiston4738
    @sarabattiston4738 4 года назад

    In this last month of quarantine I've watched your videos which saved my ass at work. Thanks

  • @CDitfort
    @CDitfort 4 года назад +4

    Great tutorial Brad. Thank you. I feel like this was ahead of my learning level which gives me a bit of home work to do. Also there are a few things different on windows but worked them out along the way. Firstly to create and activate virtual environment. Creating py -3 -m venv venv and to activate just ./venv/Scripts/activate other than that most other things are the same. Thanks for your helpful tutorials. Also if you could do a favor to future viewers please add the windows differences in comments or mention it.

    • @CDitfort
      @CDitfort 4 года назад +1

      Also had to set my powershell policy to unrestricted to run the scripts a bit of work but figured it out along the way.

    • @cooperm590
      @cooperm590 4 года назад

      @@CDitfort thank you, was having some problems with the venv part but your comment saved me haha, much appreciated

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

    New to Python and found this video to be immensely helpful, thank you!

  • @automationtesting3149
    @automationtesting3149 4 года назад

    I am relatively new to Python and this information was really useful

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

    Take note, when you work with portable versions of Visual studio code and Python you will have to browse for the interpreter. Do this in the following way:
    1. Open a Python file in Visual Studio Code
    2. Select the language mode in the bottom right corner (it not done yet).
    3. Click on "Select Python Interpreter" in the bottom left corner. In this video it is where you see the words "python 3.8.1 64-bit"
    4. A "Select interpreter" window will appear at the top. Click on "Enter interpreter path…"
    5. Browse for "python.exe" which is normally in the folder "python-x.y.z.amd64"

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

    this video was so helpful! And frankfly I just needed the first few minutes, I was having trouble with modulenotfound when "pip install prettytable" but when I install the virtual environment and access it and install there, then it works. This is my first time doing so do you have a video explaining the logic of virtual environments and why they're needed to install packages?
    By the way, all the extensions here are super useful!

  • @Lurker1222
    @Lurker1222 4 года назад +3

    You read my mind Brad! This is exactly what I needed!

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

    Thank you for high quality introduction!

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

    really helpful introduction to those tools!

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

    Great tutorial for VSCode setup, you are awesome Brad thank you!

  • @Lelouchishere
    @Lelouchishere 4 года назад +1

    It was very much needed! Thanks!

  • @aliizzetmetin6382
    @aliizzetmetin6382 4 года назад +1

    Dude this is so helpful! thanks I think will stop using mostly Jupyter now

  • @udaypatil1913
    @udaypatil1913 4 года назад

    Really waited for this video teacher.

  • @CopyPasteYoyoTricksTutorials
    @CopyPasteYoyoTricksTutorials 4 года назад +1

    I just started your udemy course today and this video is very helpful :-)

  • @jiading170
    @jiading170 4 года назад

    Thanks for being so helpful. Especially AREPL!

  • @HK-sw3vi
    @HK-sw3vi 4 года назад +2

    FYI: Git bash for some reason throws "permission denied" to python3 commands, so you might wanna switch to regular windows cmd as a default terminal for your vscode.

    • @MrTriipo
      @MrTriipo 4 года назад

      Go to app execution aliasses in w10 settings and disable python app installers, that should fix it

  • @DM-py7pj
    @DM-py7pj 3 года назад

    There is no link for copilot. Also, Kite seems to now be called Kite Autocomplete and seems to have a broader scope.

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

    12:40 the kite "docs" does not show on mine! I am on Mac Mojave with Python 3.7.6 64-bit. Thank you.

  • @domfp133
    @domfp133 4 года назад

    This video is great, really cool features! Thanks

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

    How can I have Snippets? I dont have snippets from the Python Extention (I'm on windows)

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

      They are removed in new versions od python extension

  • @elderofzion
    @elderofzion 4 года назад +3

    hey Brad, how about more webassembly?

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

    For some reason I don't see snippet suggestions after installing the python extension. Any ideas on how to resolve this issue? Looks like snippets should be enabled in the recomendations.

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

      OK, it looks like snippets were removed from the standard python VScode extension. You could add that to your vid as a note.

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

      @@joejohn6795 i was just wondering and checked comments, thanks for clearing this up

  • @automationtesting3149
    @automationtesting3149 4 года назад

    Really useful information. Keep up the good work!!!

  • @valentinasinichenko751
    @valentinasinichenko751 4 года назад

    I can't believe, it is so intuitive

  • @rohit45kashyap
    @rohit45kashyap 4 года назад +9

    Can we make a dashboard designs.
    And can you please share a small project as a challenge every week. It will be great help as well as practice.
    Thankful ❤

  • @AvrahamTOLEDANO
    @AvrahamTOLEDANO 4 года назад

    Really enjoying the way you teach!!! Professional, and most of all practical. Thanks and greetings

  • @ftaghnify
    @ftaghnify 4 года назад

    Very well paced! Great job!

  • @ugetridofit
    @ugetridofit 4 года назад

    @11:40 the terminal output is different from AREPL, what gives ?

  • @namitvarshney2142
    @namitvarshney2142 4 года назад

    sir can u please explain why created a virtual environment in the earlier part of the video?

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

    You show code snippets as part of the Microsoft Python extension but I do not think that is included in the MS Python extension. Can you share how you enabled Python code snippets?

    • @wpggez.
      @wpggez. 2 года назад

      It got disabled

  • @RickyTeachey
    @RickyTeachey 4 года назад

    This was really great the extensions you recommended are really helpful suggestions. Thanks.

  • @karljay7473
    @karljay7473 4 года назад

    I'm getting an error using Requests. I went back to make sure I was doing everything right, but I'm still getting the error: Python Requests - No connection adapters @9:33. StackOverflow says to make sure you have the '' which I do. ---------- Is there some setup process that needs to be done, some host or something?

  • @sundarnarasimhan4402
    @sundarnarasimhan4402 4 года назад

    Good video -- learned about kite after seeing it. One small thing though -- I notice the docs link appears at the bottom of my hover popups -- not at the top as you have it.. is there some setting that controls that? Thanks.

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

    Helpful, must have extensions

  • @iansapelino6407
    @iansapelino6407 4 года назад

    I have a question, how to turn off or disable using the virtual environment you've created in visual studio code? what's the command or option of it?

  • @吳博宇-x9f
    @吳博宇-x9f 3 года назад

    Hi, very useful video. I wouldl like to know if I can do some setup in order me to enter the virtual environment once I open VScode? Every time I open VScode, I have to kill the current terminal and open a new one to get in the venv (I have setup for auto activating the venv, but I do not know why it won't activate once I open the app). Thank you.

  • @thatguy1949
    @thatguy1949 4 года назад +19

    right on time when I need it... I'm so used to VSCode. it's hard for me to switch to other editors

    • @ChadSigma111
      @ChadSigma111 4 года назад

      i am new to vs code, messed up some settings, how do i restore them to default

    • @MichaelMantion
      @MichaelMantion 4 года назад

      said the man who never used emacs for a week.

    • @martinn.6082
      @martinn.6082 4 года назад +2

      @@MichaelMantion obligatory vim comment

  • @danedmdan
    @danedmdan 4 года назад

    Thank you for the video. I can not get these terminal commands to work. Is this video focused on a Unix/Max computer for executing these terminal commands? Thank you.

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

    how to show option for snippets, are we need to make it manually at user snippet ?

  • @warboom198
    @warboom198 4 года назад

    so python 3.9 is out but when i change my interpreter to it, it just throws a "modulenotfounderror" please help me!!!!

  • @lodynemark
    @lodynemark 4 года назад +1

    Very decent video, keep it up Brad. I would ask if you may do the same for setting up Django in VS Code plus recommended extensions. One love from Tanzania.

  • @gethsun1
    @gethsun1 4 года назад

    Exactly what I needed, really been fumbling a lot .. Thank you very much Trav. -:)

  • @GG-uz8us
    @GG-uz8us 3 года назад

    I really like the kite doc. But I didn't see kite when searching it in vscode extensions, only kite autocomplete, etc. Can you show how to get it?

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

    Thanks sir i am newbee it helps me lot

  • @ar3568row
    @ar3568row 3 года назад +5

    I am not getting those snippets like him , could anyone help me make those snippets visible 🙁

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

      have you checked settings?

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

      I think he missed a step in showing another Python extension other than Microsoft Python extension. Python for VSCode by Thomas Haakon Townsend includes VSCode Snippets for Python.

  • @Ashley-yr9ky
    @Ashley-yr9ky 4 года назад

    Just curious why you set up a virtual environment? I've just been using python as-is and I'm curious what the difference is?

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

    Great information!

  • @gerardoalbertoamayafuentes2709
    @gerardoalbertoamayafuentes2709 4 года назад

    Can you tell me the background theme that do you use ?

  • @colinmsmall
    @colinmsmall 4 года назад

    What do you suggest for Golang with vscode?

  • @LinhBui-dg6lv
    @LinhBui-dg6lv 3 года назад

    Why when i click run code, the program just run on terminal instead of in output tab? what should i do to run code in Output tab? thanks

  • @keyone415
    @keyone415 4 года назад

    Now you can also run your Jupyter notebook directly from VS Code; it's pretty dope, and it's included in the Python plugin already. No need to use Ananconda for Data Science anymore. I prefer to use VSCode for all my hobby projects.
    But for more involved heavy coding that I do at work, when I have multiple microservices, I switch to a JetBrains editor.

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

    Awesome tutorial! Thank you!

  • @thiagosantospires2352
    @thiagosantospires2352 4 года назад +1

    Greate! Those extensions will improve my work a lot.

  • @zhiwenqiang1778
    @zhiwenqiang1778 4 года назад +1

    Very helpful indeed, Thank you as always!

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

    While in the process of activating it, my folder didnt have a bin file. What other solutions can i use to activate it

  • @user-or7ji5hv8y
    @user-or7ji5hv8y 4 года назад

    how about using Conda instead for virtual environment?

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

    great and comprehensive!

  • @newbpod
    @newbpod 4 года назад

    do u need python already downloaded on ur computer before installing the python on vscode?

  • @Nexus-rt1bm
    @Nexus-rt1bm 4 года назад

    Bruhhhh, AREPL is godsend

  • @stuckinforloop
    @stuckinforloop 4 года назад

    @Traversy Media After I told a girl in my class about all the hassle free work she can do using this plugins she asked me out, THANK YOU mate !!!.

  • @marconarca2706
    @marconarca2706 4 года назад

    Why do i have source is not recognized at 2:32

  • @idan4329
    @idan4329 4 года назад

    what about the "Code Runner Extension"? Is it easier to create virutal environment ahead with Anaconda? . Test explorer couldn't find my test file (created a folder named pytests)

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

    Is it necessary to create "venv" for development in vs code?

  • @TheGJfM
    @TheGJfM 4 года назад +1

    Thank you! I needed this.

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

    This was awesome.. Thanks I really needed this for a current project. Quick question.. can you show or explain how to display report of the pytest test runs ? Thanks

  • @salimel8802
    @salimel8802 4 года назад

    Hello brad , the front end for devbootcamp will be the next course on udemy?

  • @leki4916
    @leki4916 4 года назад

    Hi Brad! I'm wondering of what do you think about machine learning stuffs in JavaScript like tensor flow,brain.js do you think it will become more a must learned skill in frontend jobs in near future? I just get comfortable with vanilla JavaScript and Im interested to learn these libraries, do you think it's a bad idea to jump to js machine learning from vanilla javascript? or are these libraries even practical to learn for frontend positions?

  • @yackawaytube
    @yackawaytube 4 года назад

    Exactly what I needed. Thanks!