Skip to content

PYTHONSTARTUPvariable is set by default in some environments

In some environments PYTHONSTARTUPis set as a variable by default , this causes python issues with some currently available EESSI software, example PyTorch:

user@x1000c0s0b0n0:~> env | grep PYTHON*
PYTHONSTARTUP=/etc/pythonstart

{EESSI 2023.06} [user@x1000c0s0b0n0 ~]$ ml PyTorch/2.1.2-foss-2023a
{EESSI 2023.06} [user@x1000c0s0b0n0 ~]$ python
Python 3.11.3 (main, Mar 27 2025, 10:39:25) [GCC 12.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
Could not open PYTHONSTARTUP
FileNotFoundError: [Errno 2] No such file or directory: '/etc/pythonstart'
>>> 

One workaround could be to unset PYTHONSTARTUP while loading EESSI