Fred Stluka via plug on 20 May 2020 09:18:46 -0700 |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: [PLUG] Fixing a Python library mismatch |
On 5/16/20 4:14 PM, Walt Mankowski via plug wrote:
I think both venv and pyvenv are more than I need most of the time.
Walt, Keep in mind that Python virtual environments are astonishingly lightweight. Much, much, much simpler than you might expect. I dodged them for a little while, as one more complication that I didn;t yet need. Not true. Really simple and really useful. I now use them for EVERY python project, no matter how small. As I explained to a friend recently... Not like a heavy "virtual machine", VM, that you'd get from VMware, AWS, etc. That's a whole OS running in a hypervisor. Not like a lighter, but still heavy "container" that you'd get from Docker. That's a containerized set of files, containing everything except a copy of the OS. A Python "virtual environment" is very simple. A directory, a change to your PATH and to another environment variable or two. All installs of Python libraries, add-ons, etc., go in the directory tree and the right version of Python and that tree get found via the PATH and env vars. Astoundingly useful and lightweight. Can have as many different virtualenvs as you like, each in it's own folder. To "uninstall" one, just delete the folder. Use the generated "virtualenv" (or venv or pyenv) command to create them. It also generates "activate" and "deactivate" scripts (or Windows BAT files) to switch from one virtualenv to another. Here's a page that explains how simple virtualenvs are: - https://www.recurse.com/blog/14-there-is-no-magic-virtualenv-edition @Walt, it's pitched at a real newbie level, so you'll just want to scan it quick and see that it basically says what I said above. It's a nice article though to show someone less with less Linux experience. Enjoy! --Fred ------------------------------------------------------------------------ Fred Stluka Bristle Software, Inc. http://bristle.com #DontBeATrump #SadLittleDonny #ShakeOffTheTrumpStink #MakeAmericaHonorableAgain http://MakeAmericaHonorableAgain.us/Trump/Countdown.htm ------------------------------------------------------------------------ ___________________________________________________________________________ Philadelphia Linux Users Group -- http://www.phillylinux.org Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce General Discussion -- http://lists.phillylinux.org/mailman/listinfo/plug