Created
November 7, 2019 14:47
-
-
Save tjguk/40b05d35bbce0a8ef34cd4bb32e545b7 to your computer and use it in GitHub Desktop.
Removing PYTHONPATH from environment
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os, sys | |
import subprocess | |
## env = {} | |
## env['SystemRoot'] = os.environ['SystemRoot'] | |
env = dict(os.environ) | |
del env['PYTHONPATH'] | |
print(subprocess.run(["c:/temp/mu/yyy/scripts/python.exe", "-c", 'import sys; print(sys.path)'], stdout=subprocess.PIPE, env=env).stdout) | |
print(subprocess.run(["c:/temp/mu/yyy/scripts/python.exe", "-m", "pip", "freeze"], stdout=subprocess.PIPE, env=env).stdout) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment