2

Well I currently have as main version python 3.6. I still wish to use this version as main python3 version. However next to it I wish to be able to use python 3.5 (for development of scripts used on synology, which has as newest version python 3.5).

I tried installing python 3.5 from apt:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'libpython3.5-stdlib' for regex 'python3.5'
Note, selecting 'libpython3.5-minimal' for regex 'python3.5'
0 upgraded, 0 newly installed, 0 to remove and 13 not upgraded.

However after this python3.5 --version still returns

Command 'python3.5' not found, did you mean:
  command 'python3.6' from deb python3.6-minimal
  command 'python3.7' from deb python3.7-minimal

I also cannot find any trace in /usr/bin of said installation (or previous version). If I search my computer for python3.5 I do find a lot of folders, though mostly under /snap/core/ I also know that I did have python3.5 installed at one point, and upgraded it later.

paul23
  • 8,799
  • 12
  • 66
  • 149
  • have you tried using `locate` or `find / -cmin -60 2>/dev/null`? i.e. all the files changed in the last 60 minutes? which may need a `sudo` to look around. – JL Peyret Feb 18 '20 at 16:21
  • You can install any other python version side by side. see https://stackoverflow.com/a/76867163/1762051 – Alok Aug 09 '23 at 11:19

1 Answers1

3

It's much easier to switch between different python environments and packages using conda or virtualenv. I personally use miniconda to create minimal environments.

After installation just create a new environment with your desired python version:

$ conda create --name EnvName python=3.5

And switch to that environment with $ conda activate EnvName

then4p
  • 131
  • 3
  • Well problem is that anaconda doesn't use apt or snap, so I'll be manually updating that. I'm trying to use `virtualenv` however that requires a global local installation of python first (`--python needs to point to runner, it won't download`). Which is what I'm at currently. – paul23 Feb 18 '20 at 16:12
  • Anaconda (and the envs) not updating is precisely the point. In any given environment all packages and the python isntallation itself will stay at the exact state the code was developed in. – then4p Feb 18 '20 at 16:57
  • 1
    Well of course *python* should stay the same, but using `apt upgrade` one normally checks for updates in all installed packages on ubuntu, anaconda does however not use the registry so it (a) cannot be verified and (b) it won't update. and most importantly (c) it's not free software. – paul23 Feb 18 '20 at 17:08