multiple python versions
Dan Yasny
dyasny at gmail.com
Thu Jul 22 20:05:38 IDT 2021
On Thu, Jul 22, 2021 at 12:51 PM Shlomo Solomon <shlomo.solomon at gmail.com>
wrote:
> I guess I don't completely understand the concept after all. If I setup
> a virtual environment for 3.9.6, how would it "know" that modules are
> installed in the 3.8 directory? As I wrote in my original post, without
> a virtual environment, in 3.9.6 I get:
>
> >>> import scapy
> Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> ModuleNotFoundError: No module named 'scapy'
>
> but the module does exist in 3.8:
>
> sudo pip3 install scapy
> Requirement already satisfied: scapy in
> /usr/local/lib/python3.8/dist-packages (2.4.4)
>
>
> So how do I tell the 3.9.6 environment to look for modules in the 3.8
> directory?
>
You don't, that's the whole point of venv - you have a separate set of
modules in each environment, specific to it's version.
There's the site-packages argument of course, but it's far from being
best-practice.
>
>
>
>
>
>
> On Thu, 22 Jul 2021 12:41:41 -0400
> Dan Yasny <dyasny at gmail.com> wrote:
>
> > why reinstall? Keep your versions venvs in place and hop in/out
> >
> >
> > On Thu, Jul 22, 2021 at 12:37 PM Shlomo Solomon
> > <shlomo.solomon at gmail.com> wrote:
> >
> > > Omer Zak <w1 at zak.co.il> wrote:
> > > > The answer to your prayers is pyenv.
> > > > It allows you to install multiple Python versions in parallel,
> > > > and for each version you can maintain several virtualenvs.
> > >
> > > Dan Yasny <dyasny at gmail.com> wrote:
> > > > How about using virtualenv for alternative versions?
> > >
> > >
> > > Yes, I know about pyenv and virtualenv, but wouldn't I have to
> > > re-install modules for each version/environment? That's what I'm
> > > trying to avoid.
> > >
> > >
> > > --
> > > Shlomo Solomon
> > > http://the-solomons.net
> > > Claws Mail 3.17.5 - KDE Plasma 5.18.5 - Kubuntu 20.04
> > >
>
>
>
> --
> Shlomo Solomon
> http://the-solomons.net
> Claws Mail 3.17.5 - KDE Plasma 5.18.5 - Kubuntu 20.04
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.cs.huji.ac.il/pipermail/linux-il/attachments/20210722/0423f67c/attachment-0001.html>
More information about the Linux-il
mailing list