Python Tutorial: How to Set the Path and Switch Between Different Versions/Executables (Windows)

Поділитися
Вставка
  • Опубліковано 25 лип 2018
  • In this Python Programming Tutorial, we will be learning how to set the PATH environment variable on the Windows Operating Systems.
    Be one of the first 200 people to sign up with this link and get 20% off your premium subscription. brilliant.org/cms
    We will also learn how to modify the PATH in order to switch between different Python versions and executables. This is an essential skill that trips up many people when they first start learning Python and will definitely help you in many real-world situations. Let's get started...
    How to Set the Path on Mac and Linux:
    • Python Tutorial: How t...
    ✅ Support My Channel Through Patreon:
    / coreyms
    ✅ Become a Channel Member:
    / @coreyms
    ✅ One-Time Contribution Through PayPal:
    goo.gl/649HFY
    ✅ Cryptocurrency Donations:
    Bitcoin Wallet - 3MPH8oY2EAgbLVy7RBMinwcBntggi7qeG3
    Ethereum Wallet - 0x151649418616068fB46C3598083817101d3bCD33
    Litecoin Wallet - MPvEBY5fxGkmPQgocfJbxP6EmTo5UUXMot
    ✅ Corey's Public Amazon Wishlist
    a.co/inIyro1
    ✅ Equipment I Use and Books I Recommend:
    www.amazon.com/shop/coreyschafer
    ▶️ You Can Find Me On:
    My Website - coreyms.com/
    My Second Channel - / coreymschafer
    Facebook - / coreymschafer
    Twitter - / coreymschafer
    Instagram - / coreymschafer
    #Python

КОМЕНТАРІ • 139

  • @VictorOlet
    @VictorOlet 4 роки тому +81

    (For my future reference)
    4:50 Adding directories to the path environment variable
    10:40 Find the location of the python you're using using 'sys'
    12:24 (Echo path)
    13:52 Installed a package but not found when importing it
    14:54 (Using pip show to get location of a package)
    16:50 When the CL and Editor are using different python versions (Sublime Text as example)

  • @chrystiankownacki9867
    @chrystiankownacki9867 4 роки тому +16

    Thank you Corey, this is exactly what I was looking for. Clear and easy to understand PATH breakdown. All the best!

  • @mihaigrigore2136
    @mihaigrigore2136 5 років тому +48

    Pure gold this video, like all your others I have watched on Python. Crystal clear, fast paced, direct to the target. Yours is definitely The BEST Python course I watched (and I have seen a few...). I lost a few days exactly on the path issue as I could not find a clear explanation on the path ORDER. Your video showed me exactly the detail I was missing. Thank you!!! I would include this in the playlist on videos about "Setting up a Python Environment".
    Paypal-ed you.

  • @jeremyclark9697
    @jeremyclark9697 3 роки тому

    I've spend hours on StackOverflow and numpy documentation trying to figure out why my modules won't import. This is the only advice that has actually worked. THANK YOU!

  • @bryanmedina9808
    @bryanmedina9808 3 роки тому

    This video has been extremely helpful to me. I was struggling heavily with not being able to import modules based on the IDE I used. I now have a thorough understanding of the impact and importance of setting the path. Thank you so much.

  • @sirskye8345
    @sirskye8345 2 роки тому +3

    Jack Pot! (For context, I use windows). I was trying to create a virtual environment and I ran into a block because my default python interpreter was set to the one in my c compiler(for linux, its MinGW). The venv file didn't have a 'scripts' file. It was a nightmare. Luckily, I changed my system environment path and changed it to my separately installed python interpreter for windows! Best video ever!

  • @juliancardona3508
    @juliancardona3508 6 років тому +6

    By far one of the most useful videos on UA-cam! Awesome! I pip installed flask but also installed python using anaconda which I guess is messing up flask modules along with peewee modules. Hopefully this helps me modify how my machine looks for peewee and flask libraries.

  • @benjamincruzjr.5810
    @benjamincruzjr.5810 4 роки тому

    I just stumbled onto this video as I was troubleshooting this exact issue and I couldn't be happier! Great content and easily explained!

  • @gowthamreddy2236
    @gowthamreddy2236 2 роки тому +1

    These videos are gold standard. Used to struggle with these... but not anymore... Thank you Corey...!!

  • @farzaddalavi9666
    @farzaddalavi9666 4 роки тому +1

    I really appreciate it. I was confused about how can change between different Python version and install packages. It was really helpful.

  • @avivbaltsan7583
    @avivbaltsan7583 5 років тому +5

    Finally a video covering this, and also so well explained! Thanks Corey!

  • @jeffplays8033
    @jeffplays8033 4 роки тому +2

    THANK YOU SO MUCH!!! It took me 3 videos to get to this one and it made it so clear and easy to follow, unlike the other ones, thanks again for the help!

  • @jimbb1832
    @jimbb1832 2 роки тому

    you explained this better than anyone else on the internet. It actually makes sense now, thanks

  • @rorysmith3658
    @rorysmith3658 2 роки тому

    Fantastic video - answered all my questions regarding Path and Environment Variables in a clear and succinct manner. Subscribed!

  • @rbharij7619
    @rbharij7619 4 роки тому +2

    Thanks Corey! Hours of frustration resolved, could not get Atom or Sublime to work. All the best.

  • @salarghaffarian4914
    @salarghaffarian4914 3 роки тому +1

    You are the best instructor I've ever see. Thanks for this very informative video! Awesome!

  • @lalitsoni3596
    @lalitsoni3596 Рік тому

    thanks alot sir , i am having much trouble in understanding the environment variable how to set or change them but after watching I'm clear about these things

  • @asdasasada722
    @asdasasada722 5 років тому +6

    Ty man wanted to start with it and you are the first one that actually helped. :)

  • @qzorn4440
    @qzorn4440 Рік тому

    a most excellent path video. 🥳 It is so helpful to click the path box when installing python or do this mild pain cleanup stuff. 😎 Thank you for the best how to video.

  • @lawrencew8243
    @lawrencew8243 4 роки тому +1

    Thanks Corey! explained very clearly and now I'm able to run bat file's from cmd

  • @rohanramani6243
    @rohanramani6243 6 років тому +4

    Thank You Corey. You have been really helpful in learning python

  • @usamatahir7091
    @usamatahir7091 4 роки тому +4

    This was so helpful. Thanks a lot dude!

  • @barbarairena6714
    @barbarairena6714 6 років тому +3

    thanx! Very informative!!! It will save a lot of nerves & time to a lot of people!!!! GREAT JOB!!!!!!

  • @johnyiakras6987
    @johnyiakras6987 2 роки тому

    You are the best python explainer on youtube

  • @luck3971
    @luck3971 2 роки тому

    Getting back into Python and needed a crash course on pip again. I know I can always count on Corey

  • @SteadyEddyyy
    @SteadyEddyyy Рік тому

    Very helpful video. Thank you, Corey!

  • @lightninginmyhands4878
    @lightninginmyhands4878 5 років тому +3

    AS I SAID BEFORE.... TREMENDOUS. Corey, you are covering all the bases! In my case, the coworker who wrote his program in 2.7 (boo!) :D

  • @zvs78
    @zvs78 3 роки тому +1

    Great video! All clear and simple

  • @woofie1000
    @woofie1000 3 роки тому

    I wish I could give you more than one like for this!!
    Thank you so much Corey!

  • @gawaderajesh
    @gawaderajesh 3 роки тому

    Perfect... This is most detailed video and nicely explained... Thank you

  • @satishchougule4748
    @satishchougule4748 3 роки тому

    You are a really cool and awesome guy!! I enjoy all the videos related to Python/Django.

  • @tymothylim6550
    @tymothylim6550 3 роки тому

    Thank you very much for this video! It was really well done and easy to follow :)

  • @sureshkumargondi4631
    @sureshkumargondi4631 4 роки тому +1

    Corey content is top notch always 🔥🔥👌 thanks again.

  • @dariuszspiewak5624
    @dariuszspiewak5624 Рік тому +2

    There's an easier way to open 'cmd' in the right folder. Just type 'cmd' in the address bar of the folder you're interested in and the command prompt will open to this folder immediately. No need to copy the path. This also works with PowerShell and pwsh. Hope this helps.

  • @adrianradu4399
    @adrianradu4399 5 років тому +1

    Excellent video! Subscribed

  • @jadbchelly8188
    @jadbchelly8188 3 роки тому

    Very Helpful!! saved my day

  • @gregorytippett9692
    @gregorytippett9692 5 років тому +5

    Sweet Baby Jesus this is amazingly clear and helpful. Thank you!!!

  • @shivibhatia1613
    @shivibhatia1613 5 років тому +2

    this is magic. Amazing video. Do you also teach NLP and AI using python please. I would love to join the monthly package. Phenomenal videos

  • @qrubmeeaz
    @qrubmeeaz 3 роки тому +1

    Enlightening as always!

  • @GNFR15
    @GNFR15 4 роки тому +2

    Thank you man much appreciated!

  • @Guilleluisiana
    @Guilleluisiana 3 роки тому

    Thank you very much, very useful tutorial

  • @alirezamogharabi8733
    @alirezamogharabi8733 2 роки тому

    Really helpful, Thank you!

  • @prasad1686
    @prasad1686 4 роки тому +1

    Excellent explanation - Thank you

  • @rodmayor3689
    @rodmayor3689 6 років тому +1

    Corey,
    Have you had any tutorial videos using the optimization modules in real time?
    Thanks!

  • @elirockenbeck6922
    @elirockenbeck6922 6 років тому +10

    Hey Corey,
    I can't express how much your videos have helped me. I appreciate all the effort you put in so much! I was wondering if you could possibly do some sort of video on GUI programming in python, possibly tkinter? If not do you have any recommended material for such?
    Thanks!

  • @sachynk8923
    @sachynk8923 3 роки тому

    Thank you! this works like a champ

  • @Fire_Fly_101
    @Fire_Fly_101 4 роки тому +2

    Thanks alot for this video .... your videos always saves my day... thanks alot man..!

    • @ThatBeTheQuestion
      @ThatBeTheQuestion 4 роки тому

      If only there were an alot bot on UA-cam like there is on Reddit...

  • @MrMiguelcdpmarques
    @MrMiguelcdpmarques 5 років тому

    Hi Corey. Thanks again for your videos. I would have a suggestion of a topic for your videos. Something I have heard of very often but never really understood. The Python eval function.

  • @aminelagab4830
    @aminelagab4830 5 років тому +5

    THIS IS GOLD !!!

  • @quietcopse8407
    @quietcopse8407 5 років тому +1

    excellent corey. very useful

  • @jyoutubezhu
    @jyoutubezhu 6 років тому +1

    Thank you. Very useful 👍👍👍

  • @dimitrybretoux9708
    @dimitrybretoux9708 3 роки тому

    you saved my life.Thank you

  • @gtanke
    @gtanke 5 років тому

    Thanks Corey Great Video. I have check my paths like you said in the video and it looks good but when I run python in the command line instead of python 3.7 it will run 3.5. i have to run commands py -3.7 to run python 3.7. I cannot delete 3.5 through programs and Features should i delete the python 3.5 folder not sure if i should do that though. Any suggestion, I tried google it but not any help.

  • @ZeRo-vd2mt
    @ZeRo-vd2mt 3 роки тому

    THANK YOU SO MUCH, I SUBBED TOO!! THIS HELPED ME A LOT

  • @rangabharath4253
    @rangabharath4253 6 років тому +1

    Nice one👌👍☺️

  • @viraldaddhub6950
    @viraldaddhub6950 4 роки тому

    Your video has been really helpful. I HV one query, I hv two python versions. One 3.7 and other with anaconda 3.8 but like I added both the paths to the environment variable... But when in command prompt , I write only python... Then also it says not recognised as an internal / external command... Pls help

  • @Aditya-ss1rq
    @Aditya-ss1rq 6 років тому

    Is it for Windows 8 & 10 OS..? Becoz In Widows 7 SP1, By installing Python automatically set the PATH to the environment variable and it also enables PIP with it since the Sripts folder includes in the PATH. No need to set another Scripts PATH for PIP..................sorry I was wrong. when I type pip in cmd It worked before now it says command not found. and It doesnt allow me to set scripts path below the executable path. If i add new Scripts path it replacing the original path. How to do it Windows & please?

  • @ahmedouerfelli4709
    @ahmedouerfelli4709 4 роки тому

    When upgrading to a new version of python, how to install in the new version, all at once, the modules installed in the previous version?

  • @hyper8547
    @hyper8547 3 роки тому

    You are just amazing!

  • @mageshravichandran3616
    @mageshravichandran3616 3 роки тому

    Thank you brother❤️❤️

  • @Satyamkumar-yi6um
    @Satyamkumar-yi6um 4 роки тому +1

    Thank u Corey

  • @wasitechlearning
    @wasitechlearning 4 роки тому

    my sys.executable showing 'C:\\ProgramData\\Anaconda3\\python.exe' this path which is not set at PATH. Now, what should I do? I use anaconda also for a different purpose.

  • @sissinacera5344
    @sissinacera5344 4 роки тому +1

    you are the best ever please continue with python how to buils apps ... ans thanks for you

  • @tanjakriko5190
    @tanjakriko5190 5 років тому

    hi corey i can't pip i use python 2.7 version 'pip' is not recognized as an internal or external command,
    operable program or batch file. how can i fix please help me

  • @xlu125
    @xlu125 5 років тому +1

    great job, thank you

  • @thomasre8073
    @thomasre8073 3 роки тому

    Thank you!

  • @secretr5024
    @secretr5024 7 місяців тому

    I have python310 and python312 I am trying to switch but the thing is when I installed python10 I selected the option "Add python.exe to path" Which made it so I didn't have to add it to environment variables. However python312 was installed on my system but I never even wanted it so I am trying to switch back to python310 but they are both not in environment variables so do you know how you can help me?

  • @tanushreepareek8208
    @tanushreepareek8208 Рік тому

    Hi,
    I have installed the package django and the path is the the same as in Python. When I hit the command Its giving me this error Could you please tell me what i should do to resolve this?

  • @mrj6967
    @mrj6967 2 роки тому

    tnx for this useful video of yours

  • @satisharvapalli3457
    @satisharvapalli3457 6 років тому

    Thank you Corey for helping me to make easy to execute my codes. Please make a video on 'Windows subsystem for Linux', i'm getting problem while installing virtualenv through it. I have seen your video about this. very much informative it is. Thank you.

    • @coreyms
      @coreyms  6 років тому +1

      Hey there. I already do have a video on the Linux subsystem for Windows. If you search my channel you should find it.

  • @yon1621
    @yon1621 5 років тому +1

    Thank you very very much!!!!

  • @dibyaranjanmishra4272
    @dibyaranjanmishra4272 5 років тому +1

    Amazing!!

  • @muntadher8087
    @muntadher8087 2 роки тому

    Thank you so much

  • @ab5848
    @ab5848 3 роки тому

    Thank you sir 🙏

  • @shivamwagh22
    @shivamwagh22 5 років тому

    Is the process same when you want to use Anaconda with regular Python 3.7?

  • @arhamsiddiqui2617
    @arhamsiddiqui2617 3 роки тому

    thank you!

  • @tarsus235
    @tarsus235 3 роки тому

    Why does my edit environment variable window look different than his? I'm using Window's 10 Enterprise.

  • @joker96699
    @joker96699 6 років тому

    Hey Corey, would you consider making a tutorial about flask restful? Thanks :)

  • @albert_chen
    @albert_chen 3 роки тому

    would you recommend using pyenv to manage multiple python versions?

  • @tobiass6584
    @tobiass6584 4 роки тому +1

    Thank you!!!

  • @cyberdemon667
    @cyberdemon667 Рік тому +1

    It doesnt work for me, i have v3.11 and v3.10, and it always shows 3.10 even if i delete the 3.10 paths from the environment variables

  • @powerhouses
    @powerhouses 7 місяців тому

    Hi Corey. Thanks for the wonderful videos. I'm currently in Python hell. I have to make an executable but I get this message at the very end "Error named module _bootlocale ". I'm working with code someone else wrote. I'm using Python 13.0.2 32 bit on Windows 10 64 bit. The statement from pyinstaller_versionfile import _bootlocale in my .py file is causing the issue but I need this to work for my program to work. I can't find anything on the Internet that works. I saw someone suggest change it to "from pyinstaller_versionfile import _locale" but that didn't work for me. Do you know what I can import to get my code to work?

  • @arun_sain
    @arun_sain 4 роки тому +1

    So helful

  • @mohareb7835
    @mohareb7835 3 роки тому

    hi Corey can you please make a video explain how to use MVT tool kit

  • @nziemaraangnzienguiboussou8334
    @nziemaraangnzienguiboussou8334 6 років тому

    Can you make java programming video? The way you explain is just great.

  • @manajitdas7619
    @manajitdas7619 4 роки тому +1

    thanks

  • @xBlackMambaWT
    @xBlackMambaWT 6 років тому +2

    Thanks! Although I am not native, the tutorial is very clear.

  • @yahiaessam2248
    @yahiaessam2248 4 роки тому +3

    DUUUUUUUUUUUUUDE THANK U !! Finally someone solved this problem.

  • @harshkanumuri3977
    @harshkanumuri3977 4 роки тому

    for some reason i cant change by system info paths ?

  • @Andrew-ri1mi
    @Andrew-ri1mi 4 роки тому +2

    the best quality video…

  • @Joshua-ot7fu
    @Joshua-ot7fu 4 роки тому

    is that worked if i using python 3.7 and 3.8 ?

  • @celestialbeing4767
    @celestialbeing4767 4 роки тому

    Fantastic, however, my sublime text 3 says this Python was not found but can be installed from the Microsoft Store: go.microsoft.com/fwlink?linkID=2082640. It automatically takes me to the Microsoft Store. It's a real issue. Not much information about this. Plus I think my Windows os is deleting files.

  • @barbarairena6714
    @barbarairena6714 6 років тому

    ps: does anyone know how to set a "build system" for a pipenv in the standard IDLE of python?

  • @user-ud2kn2iq5l
    @user-ud2kn2iq5l 5 місяців тому

    🎯 Key Takeaways for quick navigation:
    [\[00:00\](ua-cam.com/video/Uh2ebFW8OYM/v-deo.html)] 📂 *Introduction to working with file objects in Python,*
    - Understanding the importance of working with file objects in Python for desktop or web applications.
    - Introduction to the built-in `open` command to obtain a file object.
    [\[03:49\](ua-cam.com/video/Uh2ebFW8OYM/v-deo.html)] 🔄 *Using context managers for file operations,*
    - Explanation of using the `with` keyword for a context manager when working with files.
    - Demonstrating the benefits of context managers in automatically handling file closure.
    - Accessing the file object within the context manager using the `as` keyword.
    [\[06:08\](ua-cam.com/video/Uh2ebFW8OYM/v-deo.html)] 📄 *Reading file contents in different ways,*
    - Reading the entire content of a file using `F.read()` and storing it in a variable.
    - Exploring alternatives like `F.readlines()` and `F.readline()` to read lines or a single line.
    - Iterating through lines using a `for` loop for efficient reading of large files.
    [\[11:08\](ua-cam.com/video/Uh2ebFW8OYM/v-deo.html)] 🔄 *Efficiently reading large files in chunks,*
    - Employing a `while` loop to read a file in chunks until the end.
    - Utilizing the `F.tell()` method to track the current position in the file.
    - Demonstrating the use of `F.seek()` to change the current position in the file.
    [\[14:47\](ua-cam.com/video/Uh2ebFW8OYM/v-deo.html)] 📝 *Writing to files and using the `seek` method,*
    - Explaining the need to open files in write mode (`'w'`) for writing operations.
    - Demonstrating writing content to a file and the implications of overwriting existing files.
    - Introducing the `F.seek()` method for changing the file write position.
    [\[16:33\](ua-cam.com/video/Uh2ebFW8OYM/v-deo.html)] 📑 *Handling multiple file operations simultaneously,*
    - Opening and creating a new file for writing alongside an existing file.
    - Writing content to a file and showcasing how seek affects subsequent write operations.
    - Discussing potential use cases for the `F.seek()` method when writing to files.
    [\[18:11\](ua-cam.com/video/Uh2ebFW8OYM/v-deo.html)] 📄 *Copying text files in Python,*
    - Demonstrating how to make a copy of a text file (`test.txt`) using file objects in Python.
    - Opening the original file in read mode and the copy file in write mode.
    - Iterating through each line of the original file and writing it to the copy file.
    [\[20:37\](ua-cam.com/video/Uh2ebFW8OYM/v-deo.html)] 🖼️ *Copying image files using binary mode,*
    - Attempting to copy an image file (`Bronx.jpg`) without using binary mode and encountering an error.
    - Introducing binary mode by appending 'b' to the read and write modes (`rb` and `wb`).
    - Successfully copying the image file after enabling binary mode.
    [\[22:12\](ua-cam.com/video/Uh2ebFW8OYM/v-deo.html)] 🔄 *Copying files in specific chunk sizes,*
    - Setting up a chunk size (e.g., 4096) for reading and writing files in specific chunks.
    - Using a loop to read chunks from the original file and write them to the copy until the file is fully copied.
    - Demonstrating how to control the copy process by chunk size for more precise file operations.
    [\[24:05\](ua-cam.com/video/Uh2ebFW8OYM/v-deo.html)] 📝 *Conclusion and future topics,*
    - Summarizing the key concepts covered in the tutorial.
    - Mentioning future topics to be covered, such as working with temporary files and in-memory files.
    - Encouraging viewers to ask questions in the comment section for further clarification or assistance.
    Made with HARPA AI

  • @andresdeveloper9809
    @andresdeveloper9809 2 роки тому

    you can resolve it using virtualsenv???

  • @KingsofSummer
    @KingsofSummer 4 роки тому +1

    amazing

  • @JohnDoe-cq3ic
    @JohnDoe-cq3ic 5 років тому

    how do we actually update python? or update python with Anaconda? perhaps you can do a video on Anaconda please....and how to use, navigate around Anaconda as well as setting up environments. Thanks

  • @zaheerbeg4810
    @zaheerbeg4810 2 роки тому

    You always #Rocks. Thanks #mentor

  • @rinasoonawala6750
    @rinasoonawala6750 3 роки тому

    driver=webdriver.chrome(executable_path="C:\\Users\\LENOVO\\Downloads\\chromedriver_win32\\chromedriver.exe")
    TypeError: 'module' object is not callable
    what to do??

  • @taneliharkonen2463
    @taneliharkonen2463 2 роки тому +1

    such gold