Ubuntu 18.04 does come with a sitecustomize.py file.
I think this is not a good solution.
I would really like to be able to execute some python code during interpreter start.
AFAIK sitecustomize.py is the way to got. But if ubuntu provides one, then this does not work.
Related question: https://stackoverflow.com/questions/52449602/how-to-set-environment-variables-in-virtualenv-started-via-python
root@1b3dffd4d058:/# python Python 2.7.15rc1 (default, Apr 15 2018, 21:51:34) >>> import sitecustomize >>> sitecustomize.__file__ '/usr/lib/python2.7/sitecustomize.pyc'
root@1b3dffd4d058:/# cat /etc/os-release NAME="Ubuntu" VERSION="18.04 LTS (Bionic Beaver)"
Ubuntu 18.04 does come with a sitecustomize.py file.
I think this is not a good solution.
I would really like to be able to execute some python code during interpreter start.
AFAIK sitecustomize.py is the way to got. But if ubuntu provides one, then this does not work.
Related question: https:/ /stackoverflow. com/questions/ 52449602/ how-to- set-environment -variables- in-virtualenv- started- via-python
root@1b3dffd4d0 58:/# python __file_ _ python2. 7/sitecustomize .pyc'
Python 2.7.15rc1 (default, Apr 15 2018, 21:51:34)
>>> import sitecustomize
>>> sitecustomize.
'/usr/lib/
root@1b3dffd4d0 58:/# cat /etc/os-release
NAME="Ubuntu"
VERSION="18.04 LTS (Bionic Beaver)"