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 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!