Re: multiple python versions

2021-07-26 Thread Yedidyah Bar David
On Thu, Jul 22, 2021 at 8:31 PM Shlomo Solomon  wrote:
>
> OK - to sum up:
> 1 - thanks to Omer and Dan
> 2 - it seems that I did understand the concept of virtual environments
> - as I wrote in my original post:
> > 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.
> 3 - based on the answers you both wrote, there's no solution to the
> "problem" of having to re-install modules.
> 4 - and it's probably not a good idea to try :-)

That's the main point, not that there is no solution. If you want to
try to enforce use of modules from the other version, you can use
PYTHONPATH and/or sys.path, or even play with importlib. But it
remains a bad idea, unless you have very specific needs - not a
mere "trying to save time".

Best regards,

> 5 - based on all of the above, I'll probably pass on the idea of using
> 2 versions and wait for Kubuntu to move to 3.9, which will probably not
> be too far in the future.
>
> Again - thanks
>
>
>
> On Thu, 22 Jul 2021 20:07:20 +0300
> Omer Zak  wrote:
>
> > FALSE ECONOMICS ALERT!
> > FALSE ECONOMICS ALERT!
> > FALSE ECONOMICS ALERT!
> >
> > You say that "most modules DO work when moving to a newer version of
> > Python".
> > However when they do not work, it is a lot of work diagnosing the
> > problem and finding which module needs to have both versions installed
> > in parallel.
> >
> > It is better to spend the (relatively short and predictable) time
> > maintaining a full virtualenv for each project. And if you are short
> > on disk space, then today's disks are big and inexpensive - much less
> > expensive than the time you spend trying to save few megabytes by not
> > installing parallel versions.
> >
> >
> >
> >
> > On Thu, 2021-07-22 at 20:02 +0300, Shlomo Solomon wrote:
> > > On Thu, 22 Jul 2021 19:50:46 +0300
> > > Omer Zak  wrote:
> > >
> > > > Why do you want to avoid having to re-install modules for each
> > > > version/environment?
> > > >
> > > The short answer: too much work
> > >
> > > The slightly longer answer: Although there are certainly changes
> > > between versions of Python and/or modules, most modules DO work when
> > > moving to a newer version of Python. I don't remember re-installing
> > > everything when upgrading to a newer version of Python.
> > >
> > > But here, my problem is not upgrading, but keeping both versions.
> > >
> > >
> > >
> > >
> > > > In the general case, a module version is compatible only with a
> > > > subset
> > > > of Python versions, due to API changes from Python version to
> > > > Python
> > > > version.
> > > >
> > > > You also want to let each project decide with which module version
> > > > it
> > > > wants to work, due to potential incompatibilities between module
> > > > versions (it is no accident that pip freeze preserves installed
> > > > module
> > > > versions).
> > > >
> > > >
> > > > On Thu, 2021-07-22 at 19:37 +0300, Shlomo Solomon wrote:
> > > > > Omer Zak  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  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
>
> ___
> Linux-il mailing list
> Linux-il@cs.huji.ac.il
> http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il

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


Re: multiple python versions

2021-07-22 Thread yochai

  
  
Another option is Nix, which with some
effort can be installed in Ubuntu and can provide you with
different environments for many languages. You can use it to
create as many python installations as you want.
  


On 22/07/2021 20:05, Dan Yasny wrote:


  
  




  On Thu, Jul 22, 2021 at
12:51 PM Shlomo Solomon <shlomo.solo...@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 "", line 1, in 
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 <dya...@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.solo...@gmail.com>
wrote:
> 
> > Omer Zak <w...@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 <dya...@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
  

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


  


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


Re: multiple python versions

2021-07-22 Thread Shlomo Solomon
OK - to sum up:
1 - thanks to Omer and Dan
2 - it seems that I did understand the concept of virtual environments
- as I wrote in my original post:
> 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.
3 - based on the answers you both wrote, there's no solution to the
"problem" of having to re-install modules.
4 - and it's probably not a good idea to try :-)
5 - based on all of the above, I'll probably pass on the idea of using
2 versions and wait for Kubuntu to move to 3.9, which will probably not
be too far in the future. 

Again - thanks 



On Thu, 22 Jul 2021 20:07:20 +0300
Omer Zak  wrote:

> FALSE ECONOMICS ALERT!
> FALSE ECONOMICS ALERT!
> FALSE ECONOMICS ALERT!
> 
> You say that "most modules DO work when moving to a newer version of
> Python".
> However when they do not work, it is a lot of work diagnosing the
> problem and finding which module needs to have both versions installed
> in parallel.
> 
> It is better to spend the (relatively short and predictable) time
> maintaining a full virtualenv for each project. And if you are short
> on disk space, then today's disks are big and inexpensive - much less
> expensive than the time you spend trying to save few megabytes by not
> installing parallel versions.
> 
> 
> 
> 
> On Thu, 2021-07-22 at 20:02 +0300, Shlomo Solomon wrote:
> > On Thu, 22 Jul 2021 19:50:46 +0300
> > Omer Zak  wrote:
> > 
> > > Why do you want to avoid having to re-install modules for each
> > > version/environment?
> > > 
> > The short answer: too much work
> > 
> > The slightly longer answer: Although there are certainly changes
> > between versions of Python and/or modules, most modules DO work when
> > moving to a newer version of Python. I don't remember re-installing
> > everything when upgrading to a newer version of Python.
> > 
> > But here, my problem is not upgrading, but keeping both versions.
> > 
> > 
> > 
> > 
> > > In the general case, a module version is compatible only with a
> > > subset
> > > of Python versions, due to API changes from Python version to
> > > Python
> > > version.
> > > 
> > > You also want to let each project decide with which module version
> > > it
> > > wants to work, due to potential incompatibilities between module
> > > versions (it is no accident that pip freeze preserves installed
> > > module
> > > versions).
> > > 
> > > 
> > > On Thu, 2021-07-22 at 19:37 +0300, Shlomo Solomon wrote:
> > > > Omer Zak  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  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

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


Re: multiple python versions

2021-07-22 Thread Omer Zak
FALSE ECONOMICS ALERT!
FALSE ECONOMICS ALERT!
FALSE ECONOMICS ALERT!

You say that "most modules DO work when moving to a newer version of
Python".
However when they do not work, it is a lot of work diagnosing the
problem and finding which module needs to have both versions installed
in parallel.

It is better to spend the (relatively short and predictable) time
maintaining a full virtualenv for each project. And if you are short on
disk space, then today's disks are big and inexpensive - much less
expensive than the time you spend trying to save few megabytes by not
installing parallel versions.




On Thu, 2021-07-22 at 20:02 +0300, Shlomo Solomon wrote:
> On Thu, 22 Jul 2021 19:50:46 +0300
> Omer Zak  wrote:
> 
> > Why do you want to avoid having to re-install modules for each
> > version/environment?
> > 
> The short answer: too much work
> 
> The slightly longer answer: Although there are certainly changes
> between versions of Python and/or modules, most modules DO work when
> moving to a newer version of Python. I don't remember re-installing
> everything when upgrading to a newer version of Python.
> 
> But here, my problem is not upgrading, but keeping both versions.
> 
> 
> 
> 
> > In the general case, a module version is compatible only with a
> > subset
> > of Python versions, due to API changes from Python version to
> > Python
> > version.
> > 
> > You also want to let each project decide with which module version
> > it
> > wants to work, due to potential incompatibilities between module
> > versions (it is no accident that pip freeze preserves installed
> > module
> > versions).
> > 
> > 
> > On Thu, 2021-07-22 at 19:37 +0300, Shlomo Solomon wrote:
> > > Omer Zak  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  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.
> 
> 
-- 
"Prior to capitalism, the way people amassed great wealth was by
looting, plundering and enslaving their fellow man. Capitalism made it
possible to become wealthy by serving your fellow man." - Walter E.
Williams
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


Re: multiple python versions

2021-07-22 Thread Dan Yasny
On Thu, Jul 22, 2021 at 12:51 PM Shlomo Solomon 
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 "", line 1, in 
> 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  wrote:
>
> > why reinstall? Keep your versions venvs in place and hop in/out
> >
> >
> > On Thu, Jul 22, 2021 at 12:37 PM Shlomo Solomon
> >  wrote:
> >
> > > Omer Zak  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  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
>
___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


Re: multiple python versions

2021-07-22 Thread Omer Zak
You do not tell the 3.9.6 environment to reuse 3.8 directory modules.
The compiled code in 3.8 may be incompatible with your 3.9.6
interpreter.

Use pyenv and then use 'pip install' (under venv, it automatically
knows to use pip3 if you use any 3.x version). Do not use 'sudo'
because you are installing the module only for that virtualenv, not for
the entire system.


On Thu, 2021-07-22 at 19:51 +0300, Shlomo Solomon 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 "", line 1, in 
> 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?
-- 
$ python
>>> type(type(type))

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


Re: multiple python versions

2021-07-22 Thread Shlomo Solomon
On Thu, 22 Jul 2021 19:50:46 +0300
Omer Zak  wrote:

> Why do you want to avoid having to re-install modules for each
> version/environment?
> 
The short answer: too much work

The slightly longer answer: Although there are certainly changes
between versions of Python and/or modules, most modules DO work when
moving to a newer version of Python. I don't remember re-installing
everything when upgrading to a newer version of Python.

But here, my problem is not upgrading, but keeping both versions.




> In the general case, a module version is compatible only with a subset
> of Python versions, due to API changes from Python version to Python
> version.
> 
> You also want to let each project decide with which module version it
> wants to work, due to potential incompatibilities between module
> versions (it is no accident that pip freeze preserves installed module
> versions).
> 
> 
> On Thu, 2021-07-22 at 19:37 +0300, Shlomo Solomon wrote:
> > Omer Zak  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  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

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


Re: multiple python versions

2021-07-22 Thread Shlomo Solomon
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 "", line 1, in 
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?



 


On Thu, 22 Jul 2021 12:41:41 -0400
Dan Yasny  wrote:

> why reinstall? Keep your versions venvs in place and hop in/out
> 
> 
> On Thu, Jul 22, 2021 at 12:37 PM Shlomo Solomon
>  wrote:
> 
> > Omer Zak  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  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

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


Re: multiple python versions

2021-07-22 Thread Omer Zak
Why do you want to avoid having to re-install modules for each
version/environment?

In the general case, a module version is compatible only with a subset
of Python versions, due to API changes from Python version to Python
version.

You also want to let each project decide with which module version it
wants to work, due to potential incompatibilities between module
versions (it is no accident that pip freeze preserves installed module
versions).


On Thu, 2021-07-22 at 19:37 +0300, Shlomo Solomon wrote:
> Omer Zak  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  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.
-- 
There is no IGLU Cabal. The Cabal that can be spoken of is not the true
Cabal.
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


Re: multiple python versions

2021-07-22 Thread Dan Yasny
why reinstall? Keep your versions venvs in place and hop in/out


On Thu, Jul 22, 2021 at 12:37 PM Shlomo Solomon 
wrote:

> Omer Zak  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  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
>
___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


Re: multiple python versions

2021-07-22 Thread Shlomo Solomon
Omer Zak  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  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

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


Re: multiple python versions

2021-07-22 Thread Omer Zak
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 "", line 1, in 
> > 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


Re: multiple python versions

2021-07-22 Thread Dan Yasny
How about using virtualenv for alternative versions?

On Thu, Jul 22, 2021 at 12:05 PM Shlomo Solomon 
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 "", line 1, in 
> 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.
>
> Any ideas would be appreciated.
>
>
>
>
>
>
> --
> Shlomo Solomon
> http://the-solomons.net
> Claws Mail 3.17.5 - KDE Plasma 5.18.5 - Kubuntu 20.04
>
> ___
> Linux-il mailing list
> Linux-il@cs.huji.ac.il
> http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il
>
___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


multiple python versions

2021-07-22 Thread Shlomo Solomon
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 "", line 1, in 
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.

Any ideas would be appreciated.






-- 
Shlomo Solomon
http://the-solomons.net
Claws Mail 3.17.5 - KDE Plasma 5.18.5 - Kubuntu 20.04

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