Issue
Coming from JavaScript I'm familiar with NPM.
There you can install packages globally (by using the -g flag) or locally in a project. In Python they have these Virtual Environments. I'm still a bit uncertain why they are needed. I know that it is for having the same package in different versions on one machine.
Is it because Python doesn't have the concept of local project-installations?
All package-installations are installed global and there's no way around that. It seems to me being that way ... And so they have does Virtual Environments instead?
I'm a right there?
Solution
Is it because Python doesn't have the concept of local project-installations?
Correct.
Well, mostly correct. There's a number of "modern" Python package managers that support project-local package installation. Right now the big two are pipenv and poetry.
However, all of these libraries are fundamentally wrappers over the basic Python virtual environment mechanism. It's the basis of the ecosystem.
Global package management is a little thorny in Python because Unix systems tend to come with a "system Python" installation that support parts of the operating system. Installing/updating packages in the system Python is a very bad idea, so you always want to be working in a Python you installed yourself, either a fully separate installation or at least a virtual environment of the system Python.
Answered By - Josh Karpel
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.