Installation issue on macOS Sequoia 15.5

Versions

FLUKA: FLUKA 4-5.2
Flair: 3.4-5.4
Operating system: macOS Sequoia 15.5
Compiler: GNU Fortran (gfortran) 13.4.0

Description

Dear Fluka experts,
I just installed the latest versions of FLUKA and Flair on my macOS, but I think something is wrong because when I run Flair, I see what’s shown in the attached photo: flair runs but appears empty and no any action is possible.

A warning message appears in the terminal:

DEPRECATION WARNING: The system version of Tk is deprecated and may be removed in a future release. Please don't rely on it. Set TK_SILENCE_DEPRECATION=1 to suppress this warning.
>w> Warning: PIL.Image and PIL.ImageTk not found

Thank you for your help.

Corrado

Hi,

I ran into the same problem after installing Flair 3.4-5.4 on macOS. In my case, the problem was caused by Pillow not being installed in the correct Python 3.13 environment used by Flair.

Installing Pillow explicitly for Python 3.13 fixed the issue:

python3 -m ensurepip  

python3.13 -m pip install Pillow

After this, Flair started correctly, and the GUI worked as expected.

Best wishes,

Heiley

Thank you for your suggestion. I carried out a few additional tests and I have a better understanding of the issue now.

Initially, Flair was using the default macOS Python (Python 3.9.6 located in /usr/bin/python3). In that case, the GUI opened but remained completely empty and unusable. The terminal showed:

Warning: PIL.Image and PIL.ImageTk not found

Following your suggestion, I installed Pillow for the default Python. The PIL warning disappeared, but the GUI was still empty.

I then noticed that the Flair documentation explicitly recommends not using the default macOS Python, but instead using a MacPorts Python.

I already have several Python versions installed through MacPorts. By forcing Flair to use the MacPorts Python, for example:

PYTHON=/opt/local/bin/python3 flair

the GUI now opens correctly. However, two things happen:

  1. The application now runs through XQuartz (which I assume is expected since the MacPorts Python uses the X11/Tk backend).

  2. The warning

Warning: PIL.Image and PIL.ImageTk not found

appears again.

So it seems that:

  • the original empty GUI was caused by using the Apple-provided Python;

  • the MacPorts Python fixes the GUI issue;

  • however, the MacPorts Python currently used by Flair cannot find the Pillow (PIL) module.

Could you please advise which Python version is currently recommended for FLUKA/Flair on macOS Sequoia (3.10, 3.12, 3.14, etc.), and which corresponding Pillow package should be installed?

Thank you very much for your help.

Dear Corrado,

you can try to install Pillow using pip with:

/opt/local/bin/python3 -m pip install Pillow

Cheers,
David

Dear David,

thank you very much for your help.

I followed your suggestion and installed Pillow in the MacPorts Python with:

/opt/local/bin/python3 -m pip install Pillow

Now, when I launch Flair with

PYTHON=/opt/local/bin/python3 flair

the GUI works correctly and the previous warning about PIL.Image and PIL.ImageTk has disappeared.

I also found the reason for the “Fluka directory is not found” message. My FLUPRO environment variable was pointing to an old, non-existing installation. Temporarily setting

export FLUPRO=/Users/corrado.tine/fluka4-5.2
export PATH=$FLUPRO/bin:$PATH

allows Flair to find the FLUKA installation correctly.

However, both of these solutions are only temporary.

At the moment, every time I open a new terminal I still have to launch Flair with

PYTHON=/opt/local/bin/python3 flair

and I also have to reset the FLUPRO and PATH variables manually.

Could you please advise the recommended way to make these settings permanent?

In particular:

  • how should I configure Flair so that it always uses the MacPorts Python instead of the default Apple Python?

  • what is the recommended way to permanently configure the FLUPRO environment variable and the PATH so that Flair automatically finds the FLUKA installation?

Thank you again for your help.

Best regards,

Corrado

Dear Corrado,

if you are using the default zsh shell on Mac, then you can save the commands in the ~/.zprofile file, like:

export PYTHON=/opt/local/bin/python3
export PATH=<pathToFluka>/bin:$PATH

(You may need to log out and log back in to take effect.)

This way you can start Flair by simply using the flair command, and it will use the Python specified in the $PYTHON environment variable.
Setting the $FLUPRO environment variable is not necessary; you can directly add FLUKA’s directory to $PATH.

Cheers,
David

Dear David,

thank you very much for your help.

Following your suggestions, I was able to get everything working correctly.

Since I already had a ~/.zshrc file (but no ~/.zprofile), I updated ~/.zshrc instead.

Originally, it contained:

alias flair='/Users/corrado.tine/flair-3.4/flair'
export FLUPRO=/Users/corrado.tine/fluka3.4

I replaced it with:

export PYTHON=/opt/local/bin/python3
export PATH=/Users/corrado.tine/fluka4-5.2/bin:$PATH
alias flair='/Users/corrado.tine/flair-3.4/flair'

After restarting the terminal, everything now works as expected:

  • flair uses the MacPorts Python automatically.

  • The GUI opens correctly.

  • The PIL.Image / PIL.ImageTk warning has disappeared.

  • FLUKA is found automatically without specifying the FLUKA directory in the Preferences dialog.

Could you please confirm that this is the recommended configuration, or whether you would still advise using ~/.zprofile instead of ~/.zshrc?

Thank you again for your support.

Best regards,

Corrado

Dear Corrado,

The difference is that .zprofile is executed when you log in, and .zshrc is when you open a terminal.

In your case, there is no real difference where you put these commands.

Cheers,
David