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

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

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

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,

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

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.

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

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

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,

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

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

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

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

Python and Ubuntu versions

2021-07-22 Thread אורי
Hi, I have a production server with Ubuntu 18.04 LTS (currently upgraded to Ubuntu 18.04.5 LTS) and I use Python in virtualenv - currently Python 3.6.9. I'm using Django and I read that from Django 4.0, a minimal version of Python 3.8 will be required. I would like to know how I use the latest