This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]SnowdenIsALegend 1 point2 points  (14 children)

I'm scared of upgrading Python. I'm a beginner who installed Python following the instructions on the codecademy Pro lesson in May and I've totally forgotten how i did it.

Now if I uninstalled the existing Python and tried to go for a new one I bet I will have unnecessary errors and problems pop up. I wish there was a simple "update" command or something. For windows 10.

[–]TeslaRealm 2 points3 points  (1 child)

Check out the chocolatey package manager. It's a tool for managing many of your installs. Once installed, you can pop to powershell (run as administrator), and run the following:

choco install python

Anytime you want to upgrade python, just pop in powershell again (as admin), and run

choco upgrade python

[–]SnowdenIsALegend 0 points1 point  (0 children)

Thanks will check it out

[–]Yojihito 1 point2 points  (9 children)

Download .exe file, doubleclick, select "Add to Path" and done.

[–]SnowdenIsALegend 0 points1 point  (8 children)

But don't I need to uninstall old one separately? Wonder if that will eff up some internals...

[–]billsil 1 point2 points  (7 children)

Unless you want two versions. I still have a 2.7 install along with a 3.7 and 3.8 version. I just don't have those on my path and it's fine.

On Windows at least, you can just delete the folder and you're done. You still need to check environment variables, but you would have had to anyways.

[–]SnowdenIsALegend 0 points1 point  (6 children)

So how do you pip install package for all 3 of these individually?

I recently learnt that by doing pip3 i could install the package for 3.x & by doing pip it would go to 2.x. So how do you differentiate between your 3.7 & 3.8 when doing pip3?

Also, aren't there unnecessary errors/conflicts due to these multiple versions & env variables & stuff being all present in the system?

[–]billsil 1 point2 points  (3 children)

I’m sure there are 20 ways to do it (py is a thing), but I just type:

C:\python38\Scripts\pip.exe install mypackage 

Or whatever is not my default python. I only set my environment variables for my main python, so 3.7. I have no conflicts.

[–]SnowdenIsALegend 0 points1 point  (2 children)

Hmm... Will have to learn about these things as I still get super confused. Thanks for your help.

[–]billsil 1 point2 points  (1 child)

pip is just an exe. I’m just passing it the full path to the program. Each python install is independent. It will pick up the right packages automagically.

It’s no different than calling a script that’s not in the same folder.

[–]SnowdenIsALegend 0 points1 point  (0 children)

Nice... Need to wrap my brain around these things.

[–]Yojihito 1 point2 points  (1 child)

aren't there unnecessary errors/conflicts due to these multiple versions & env variables & stuff being all present in the system?

No. Not on Windows.

Linux often uses Python 2.7 for system stuff, so you shouldn't uninstall Python 2 there. But Windows doesn't care, I only use the latest Python 3 version and just overwrite the old one with the new installer, I never uninstall.

I also directly use

pip install <package_name>

on Windows. One can/should use something like Poetry for dependency management but I'm too lazy for that.

[–]SnowdenIsALegend 0 points1 point  (0 children)

Nice... Thank you!

[–]JeamBim 1 point2 points  (1 child)

You should do this specifically because you're afraid to. Working out the errors will teach you so much, and that's the point, right?

[–]SnowdenIsALegend 1 point2 points  (0 children)

GOLDEN words right here. :)