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.

For more information:
https://github.com/pyenv/pyenv
https://ostechnix.com/pyenv-python-version-management-made-easier/



On Thu, 2021-07-22 at 12:09 -0400, Dan Yasny wrote:
> How about using virtualenv for alternative versions? 
> 
> On Thu, Jul 22, 2021 at 12:05 PM Shlomo Solomon <
> shlomo.solo...@gmail.com> wrote:
> > The default Kubuntu installation is 3.8.10 and I do not want to
> > uninstall it since that could potentially "break" something.
> > 
> > But for various reasons (not relevant to this discussion), I also
> > have
> > 3.9.6 installed.
> > 
> > I can run either one of them, but in some cases, imports of modules
> > that work in 3.8.10 don't work in 3.9.6.
> > >>> import scapy
> > Traceback (most recent call last):
> >   File "<stdin>", line 1, in <module>
> > ModuleNotFoundError: No module named 'scapy'
> > 
> > Although I don't want to re-install all modules, I "experimented"
> > and
> > got:
> > 
> > sudo pip3 install scapy
> > Requirement already satisfied: scapy in
> > /usr/local/lib/python3.8/dist-packages (2.4.4)
> > 
> > So even if I was willing to re-install everything, it would not
> > work
> > since the modules are already installed, but 3.9.6 does not "look"
> > for
> > them in the 3.8 directory.
> > 
> > I know I can use venv to set up virtual environments for different
> > versions, but although I haven't tried it, I don't see how that
> > would
> > solve the problem.
> > 
-- 
QA People of Curse.
My own blog is at https://tddpirate.zak.co.il/

My opinions, as expressed in this E-mail message, are mine alone.
They do not represent the official policy of any organization with
which I may be affiliated in any way.
WARNING TO SPAMMERS:  at https://www.zak.co.il/spamwarning.html



_______________________________________________
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il

Reply via email to