Post AcfxcrmcIiOCTxvaTY by fpbhb@mastodon.social
(DIR) More posts by fpbhb@mastodon.social
(DIR) Post #AcfvnnlVNcHTIXUiVk by simon@fedi.simonwillison.net
2023-12-10T18:51:08Z
0 likes, 0 repeats
I kind of wish Python virtual environments were just called "environments" - maybe that would make them a tiny bit less intimidating to newcomers
(DIR) Post #AcfvyrY5eX9wDaUgqG by timhaines@mastodon.social
2023-12-10T18:53:46Z
0 likes, 0 repeats
@simon 100%
(DIR) Post #AcfwZWmtnya8Xju6zo by scattapilla@jorts.horse
2023-12-10T18:58:18Z
0 likes, 0 repeats
@simon i think the hostile part is the part where it yells at you because it cant find the package you just installed, not the name
(DIR) Post #AcfxcrmcIiOCTxvaTY by fpbhb@mastodon.social
2023-12-10T19:11:48Z
0 likes, 0 repeats
@simon Great idea! Underlining the normality of using environments. And we should add preventing package installation outside of environments (on platforms that allow this without sudo), because this virtually (ha!) is never what is intended.
(DIR) Post #Acfyhbd7svWbmpJRBI by pljung@mastodon.world
2023-12-10T19:24:20Z
0 likes, 0 repeats
@simon To build on that thought, I suggest we call them **w**irtual environments, where the **w** stands for "wtf definitely use this otherwise your life will soon be miserable".
(DIR) Post #AcfyrfD9QRW7mxxVKK by billseitz@toolsforthought.social
2023-12-10T19:24:58Z
0 likes, 0 repeats
@simon containers?
(DIR) Post #Acg0GCh6ggGgXUEgMq by mterhar@bfd.so
2023-12-10T19:41:38Z
0 likes, 0 repeats
@simon Snake pits? Cages?
(DIR) Post #Acg0tDXVTkusSDLfkG by kisharrington@mastodon.social
2023-12-10T19:48:40Z
0 likes, 0 repeats
@simonSame, but for VR
(DIR) Post #Acg1IRKTLVn8ShHLZA by sbank@hachyderm.io
2023-12-10T19:53:16Z
0 likes, 0 repeats
@simon or don’t even make it a choice somehow. First `pip3 install` create a “default” venv or something.
(DIR) Post #Acg7gd83j3MRjWOHYW by adamchainz@fosstodon.org
2023-12-10T21:04:44Z
0 likes, 0 repeats
@simon Good point! Environments are in no way “virtual”, “simulated” or “unreal”. We don’t “virtually” install packages into them. Indeed the word “virtual” never comes up...
(DIR) Post #Acg8BgdUjjJ9aSu4JM by Biggles@qoto.org
2023-12-10T21:08:25Z
0 likes, 0 repeats
@simon Crazy idea - the pre-installed system python should come out-of-the-box with one default pre-installed virtual environment, activated on user login. Make it a default. That way you can't accidentally screw up the system python, but can still just install modules. The python distro should *just do the right thing* and not count on the end-user doing the right thing after the fact.
(DIR) Post #AcgKhRGobIYueDCazw by colindean@mastodon.social
2023-12-10T23:30:09Z
0 likes, 0 repeats
@simon it's a big reason why I guide new projects to use poetry or pipenv, to then use "poetry run toolname --option". I've seen so many people including myself mess up virtualenv use.
(DIR) Post #AcgNxvBZRXjZvNIfku by mia@hcommons.social
2023-12-10T19:52:26Z
0 likes, 0 repeats
@billseitz @simon I like 'containers'. And ideally there'd be one, well documented for newbies, super-reliable way to do them, swap between and return to them
(DIR) Post #AcgNy0fB4tO6ueBt68 by simon@fedi.simonwillison.net
2023-12-11T00:07:13Z
0 likes, 0 repeats
@mia @billseitz I worry they people will confuse containers with Docker and Kubernetes
(DIR) Post #AcgOhn1I8TMnv4Mca0 by LukeBrowell@mastodon.scot
2023-12-11T00:15:18Z
0 likes, 0 repeats
@simon It would be even less intimidating if they were just called envs and that activating them didn’t involve sourcing a file in a relative directory. $ python env foo should activate a venv called foo (and initialise it, if it doesn’t already exist).
(DIR) Post #AcgSeclYCcSx47kOYa by mia@hcommons.social
2023-12-11T00:59:34Z
0 likes, 0 repeats
@billseitz @simon yeah, it's not a perfect term, but it kinda does the job
(DIR) Post #AchaOGvqbepRVUElUm by smach@masto.machlis.com
2023-12-11T14:00:55Z
0 likes, 0 repeats
@simon I couldn’t help myself, I asked GPT-4 for 10 ideas to rename Python virtual environment. (I used phind.com, they give you 10 free GPT-4 queries per day)
(DIR) Post #AciJ2LngJzUYAjL4Ea by brettcannon@fosstodon.org
2023-12-11T22:21:13Z
0 likes, 0 repeats
@simon Unfortunately conda environments make the term ambiguous.
(DIR) Post #AciP6SvmLqi7AdTIqO by simon@fedi.simonwillison.net
2023-12-11T23:29:08Z
0 likes, 0 repeats
@brettcannon I'll be honest, m I don't fully understand the difference between a pip virtual environment, and a Conda environment
(DIR) Post #AciPROPOMQ3LE4IlZQ by adriano@lile.cl
2023-12-11T23:31:19Z
0 likes, 0 repeats
@simon @brettcannon With Conda environments, you just Have To Look At Their Buttssorry.
(DIR) Post #AciqTbL7x23efmaIpU by SnoopJ@hachyderm.io
2023-12-12T04:36:00Z
0 likes, 0 repeats
@simon @brettcannon the way I usually explain it is that a venv is a Python interpreter + some packages installed for it. That interpreter knows to use the environment's packages, providing isolation.Conda (aims to) provides the same sort of isolation, but in a way that generalizes beyond Python (i.e. a conda env may not even have a Python interpreter)
(DIR) Post #AcjBHuzx8LijClx0bo by jezdez@publicidentity.net
2023-12-12T08:29:11Z
0 likes, 0 repeats
@simon @brettcannon Happy to elaborate! 🤩Conda doesn’t only support cross-platform, cross-architecture Python distributions and packages (natively for non-pure Python packages that includes their dependencies, and mostly pure Python packages via pip etc), but is able to isolate any type of package set just like virtualenv, but independent of program language/ecosystem.