This isn't possible.
Child processes inherit their environments from their parents rather than share them. Therefore any modifications you make to your environment will be reflected only in the child (python) process. Practically, you're just overwriting the dictionary the os
module has created based on your environment of your shell, not the actual environment variables of your shell.
https://askubuntu.com/questions/389683/how-we-can-change-linux-environment-variable-in-python
Why can't environmental variables set in python persist?