AFNI install question - python3

Dear all,

I have pip and matplotlib installed in python3, the IT support try to install pip and matplotlib in python2 with no success.
In afni python version : 2.7.18
Can I change it to python3?

Are there other solutions so I can run -html_review_style in afni_proc? -check_all

-------------------------------- general ---------------------------------
architecture: 64bit
cpu type: x86_64
system: Linux
release: 5.13.0-39-generic
version: #44~20.04.1-Ubuntu SMP Thu Mar 24 16:43:35 UTC 2022
distribution: Ubuntu 20.04 focal
number of CPUs: 16
apparent login shell: bash
shell RC file: .bashrc (exists)

--------------------- AFNI and related program tests ---------------------
which afni : /home/taliw/abin/afni
afni version : Precompiled binary linux_ubuntu_16_64: Sep 15 2023
: AFNI_23.2.10 'Marcus Didius Severus Julianus'
AFNI_version.txt : AFNI_23.2.10, linux_ubuntu_16_64, Sep 15 2023, official
which python : /usr/bin/python
python version : 2.7.18
which R : /usr/bin/R
R version : R version 3.6.3 (2020-02-29) -- "Holding the Windsock"

instances of various programs found in PATH:
afni : 1 (/home/taliw/abin/afni)
R : 1 (/usr/bin/R)
python : 1 (/usr/bin/python2.7)
python2 : 1 (/usr/bin/python2.7)
python3 : 1 (/usr/bin/python3.8)

------------------------------ python libs -------------------------------

** failed to load module matplotlib.pyplot
-- matplotlib.pyplot is required


The issue is that, while you have multiple Python versions on your OS, your system is set up to have the default "python" command point to Python 2.7, as shown in these lines:

 which python : /usr/bin/python
python version : 2.7.18

From the install instructions for Ubuntu 20.04 here, can you run this:

sudo apt-get update

sudo apt-get install -y python-is-python3 

... and then open a new terminal, see if that makes Python 3 the default Python on your system? You can copy+paste the output of the AFNI system check: -check_all



Thank you!

taliw@hp-taliw:~$ sudo apt-get install -y python-is-python3
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
python-is-python2 : Breaks: python-is-python3 but 3.8.2-4 is to be installed
python-is-python3 : Breaks: python
Breaks: python-is-python2 but 2.7.17-4 is to be installed
zoom : Depends: libxcb-cursor0 but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

I am surprised to see 'python-is-python2': I had not heard of that before.

The answer here by "user1088081" suggests that uninstalling "python-is-python2" should be done before installing "python-is-python3", as both cannot be installed simultaneously:

However, it first appears that you have to resolve a previous install (of Zoom) that had unmet dependencies. For that, you should first run this (perhaps with sudo out front, if this doesn't work as is):

apt --fix-broken install

Having unmet dependencies (which can happen if an install is interrupted) makes it very hard to install other things.

Another way to go is to install Python and your modules of interest via miniconda, for which we have notes here. In some cases, that is necessary/useful to get modern modules on older operating systems.

Though again, you might still want to resolve the "unmet dependencies" issue, because that will only cause further inconvenience when you need other software on that machine.


Problem solved :upside_down_face: thank you!

after running

apt --fix-broken install

python version : 3.8.10

Ah, great news, glad that sorted things.