PEP668 / pipx and "--editable" installs
Rimu Atkinson
rimuatkinson at gmail.com
Sat Sep 16 19:57:41 EDT 2023
> It is nothing bad about using virtual environments but also not about
> not using them. In my own work I haven't see a use case where I needed
> them. And I expect that some day I'll encounter a use case for it. This
> here is not about pro and cons of virtual environments.
>
You are in a use case where you need them, right now :) When you
understand the benefits of virtual environments you will understand what
I meant by that.
> Please explain how the two problems I explained are influenced by not
> using virtual environments.
The first problem can be avoided because virtual environments can use a
different version of python than the system one. If you need an earlier
version of python then you can use it instead.
The second problem can be avoided because virtual environments exist in
a part of the file system that you have write access to, so you don't
need to use sudo to install packages. Your main user account does not
have write access to /usr/bin.
Also when a virtual environment is activated the path to it's packages
is a part of that environment so your code will always be able to import
the packages you want.
It's much easier to understand if you try it for yourself. Google has
many excellent resources, here is one
https://www.freecodecamp.org/news/how-to-setup-virtual-environments-in-python/
Best of luck :)
R
More information about the Python-list
mailing list