Sujet : Re: Pip installs to unexpected place
De : bowman (at) *nospam* montana.com (rbowman)
Groupes : comp.lang.pythonDate : 20. Apr 2025, 05:34:39
Autres entêtes
Message-ID : <m6jbquFe1h3U1@mid.individual.net>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13
User-Agent : Pan/0.160 (Toresk; )
On Sat, 19 Apr 2025 15:56:16 -0400, Thomas Passin wrote:
My problem with venvs, especially if I have more than one, is that I
eventually forget what they were for and what is different about each
one. If there's only one and it's used for all non-system work, that's
OK but beyond that and they tend to suffer knowledge rot.
My Python directory has
apple/ create/ fastapi/ lunar/ numerical/ pyside6/ weather/
comics/ django/ folium/ ml/ sqlite/ coursera/ impractical/
nn/ pyqt/ torch/
Not all like sqlite are venvs since no additional modules are needed. Even
if I'm a little hazy about 'apple' after a while a quick look at the
Python file shows '
https://itunes.apple.com/search' and I remember it is
to pull down artist/track info from the itunes database.
I also try to remember to run 'pythom -m pip freeze > requirements.txt'
after I get everything set up. That way if a OS update installs a new
version of Python something like
python3 -m venv folium
cd folium
. bin/activate
python -m pip install -r requirements.txt
will refresh the venv and install the appropriate packages for the new
Python version. That's faster than looking at lib/python3.10/site-packages
or whatever the previous version was and adding the dependencies or
trying to run the py file and getting
Traceback (most recent call last):
File "/home/rbowman/work/python/impractical/benford.py", line 5, in
<module>
import matplotlib.pyplot as plt
ModuleNotFoundError: No module named 'matplotlib'