0

I use Ubuntu 16.04 at work, and the machine is managed by the IT department. (i.e. I cannot use sudo)

The other day I asked them to install different python version (3.7 and 3.8 specifically), but they were so concerned to destroy the system that I was told to use Anaconda.

But I thought packages, installed by apt, that uses python wouldn't be affected by merely installing different versions of Python via apt, as python and python3 wouldn't point to different version. Not having enough knowledge on Linux's package management, however, I am not sure my assumption is true.

Could anyone "prove" installing different python version won't interfere with the system?

4
  • 1
    Why not install Python as local user? – Murphy Feb 2 '20 at 14:34
  • 1
    "wouldn't point to different version"? You seem to have a negation here. – ctrl-alt-delor Feb 2 '20 at 16:30
  • 2
    It may break badly written scripts created by your organisation. The debian alternatives system should be set up to make python point to python2. That way old scripts should continue to work. – ctrl-alt-delor Feb 2 '20 at 16:33
  • I'm aware of other choices such as build from source and use make altinstall. My thought is that apt provides safety that different versions of python can "co-exist", provided symlinks aren't changed and python was installed by nothing but apt. I would like to confirm that. – kh_0828 Feb 2 '20 at 22:31
1

Python is used extensively by all sorts of system adminstration tasks. Python 3 is quite incompatible with Python 2 (Fedora is finishing the painful process of porting everything over). Just replacing a critical package "because I, user, want a new version" won't fly, sorry. If the distribution isn't set up to run both side by side, you are out of luck (if it's your own machine, go wild; if it explodes, you get to keep the mess).

If you require it, install it (and any packages you need) in your home directory.

2
  • 1
    Installing newer versions of Python3 on top of the existing one, which is 3.5, won't break the system dependency (i.e. what /usr/bin/python3 is symlinked to), would it? That way I thought ubuntu was capable of running multiple python versions side by side. – kh_0828 Feb 3 '20 at 3:10
  • @kh_0828, OP asks for proof. – vonbrand Feb 5 '20 at 12:46
1

straight to the point, you can safely ask to install pyenv, so far the best option (and easy to setup per-user, per-folder) to test different python versions (also ankward setups like different python 3.8.x-z minor release at the same moment)

Actually I use it to run both old code (python 2.6) that needs to be updated, and fresh code already on 3.8.x libs, without touching system installation.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.