Ok. Sounds good @pf_moore.
So, if I’m using python IDLE, how would I import any new/non-standard
modules? Would I need to set up an IDLE for EACH venv environment?
I expect you’d just need to invoke the IDLE from inside the target
virtual environment. I’m not an IDLE user though.
I’m asking because it seems like VANILLA PYTHON ISN’T THE WAY TO
DEVELOP. Maybe, ANACONDA or PyCharm? It seems like they have a better
work flow and development flow.
@pf_moore’s statement: “Generally, we recommend not installing stuff
into your system Python because if you do so, then you risk getting
problems when two of your programs have conflicting requirements” has
two aspects to it.
First, pip
has a --user
option to install package in your personal
collection-of-packages (versus installing in the Python install’s area).
IIRC that’s the default these days - it prevents polluting the
system-wide Python install with your personal additions.
Second, development.
For my personal stuff I use plain pip install --user
. Or I would
except that I’ve got a few Pythons installed, so in fact I do make a
venv even for my personal use so that I can pick the Python flavour.
For development, a venv is useful because it lets you pick and choose
requirements for the project. This one might want pandas, that one might
want django etc. You generally want to enumerate these so that you can
tell people using your project what they need to install, either
overtly or as metadata.
So I just make a venv at need. It is the work of a moment to make one in
your project’s dev dir and use it as required. Once it’s there, using it
or intalling packages into it is equally easy.
So I’m a “vanilla Python with a venv for dev” person.
Cheers,
Cameron Simpson cs@cskk.id.au