Thursday, August 21, 2014

Setting the PYTHONPATH with Powershell

Powershell is the Windows hacker's best friend until it isn't.  Actually, I really do enjoy the power you get from Powershell.  However, figuring out how to set my python path in the shell was a frustrating experience that I hope to spare other users from.

PS C:\Users\spearsc> Get-ChildItem Env:PYTHONPATH

Name                                    Value
----                                        -----
PYTHONPATH                     r:/env


PS C:\Users\spearsc> $env:PYTHONPATH = "D:/localenv"
PS C:\Users\spearsc> Get-ChildItem Env:PYTHONPATH

Name                           Value
----                               -----
PYTHONPATH           D:/localenv

There you have it!  Pretty sure this setting is not permanent, which is fine for testing purposes.

3 comments: