What is the correct way to unset a linux environment variable in python? December 21, 2022 by Tarik Just del os.environ['MYVAR'] should work.