Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

How do I change the environment variable PYTHONUSERBASE.

For example in Windows I want it to be:

c:\mysite

I tried this:

set PYTHONUSERBASE=c:\mysite

When I run python setup.py install --user

it still installs to the default location.

I am using Windows 7 with PowerShell.

More info here about how to use PYTHONUSERBASE. http://www.python.org/dev/peps/pep-0370/

I noticed most people prefect virtualenv but Python 2.6 introduced this new method.

share|improve this question
add comment

1 Answer

Start -> Computer -> (Right Click) Properties -> Advanced System Settings -> Environment Variables

You might need to restart your active PowerShell session for the new environment variables to kick in.

To change it from within PowerShell try:

$env:PYTHONUSERBASE = "c:\mysite"

share|improve this answer
    
I actually know that way. I want to change the PYTHONUSERBASE variable from WITHIN the command line specifically. –  klandshome Jul 7 '13 at 21:28
    
Try $env:PYTHONBASEUSER = "c:\mysite" –  kroolik Jul 7 '13 at 21:52
    
How should I check to see if it went into effect? –  klandshome Jul 7 '13 at 22:07
1  
Get-ChildItem Env: to list all variables, $Env:PYTHONUSERBASE to print PYTHONUSERBASE variable. More about PowerShell environment variables can be found here technet.microsoft.com/en-us/library/ff730964.aspx –  kroolik Jul 8 '13 at 8:11
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.