2

I am installing active python, django. I don't know how to set the python path in vista environment system.

First of all will it work in vista?

vvvvv
32.9k19 gold badges70 silver badges103 bronze badges
asked Jan 16, 2009 at 12:33
0

3 Answers 3

3

Temporary Change

To change the python path temporarily (i.e., for one interactive session), just append to sys.path like this:

>>> import sys
>>> sys.path
['',
 'C:\\Program Files\\PyScripter\\Lib\\rpyc.zip',
 'C:\\Windows\\system32\\python27.zip',
 'C:\\Python27\\DLLs',
 'C:\\Python27\\lib',
 'C:\\Python27\\lib\\plat-win',
 'C:\\Python27\\lib\\lib-tk',
 'C:\\Python27',
 'C:\\Python27\\lib\\site-packages']
>>> sys.path.append(directory_to_be_added)

Permanent (More or Less) Change

Go to Computer -> System Properties (Either by the big button near the title bar or in the context-menu by right-clicking) -> Advanced Settings (in the right-hand nav bar) -> Environment Variables. In the System Variables, either add a variable called PYTHONPATH (if it's not already there, i.e., if you haven't done this before) or edit the existing variable.

You should enter the directories normally (take care to use backslashes, not the normal ones) separated by a semicolon (;) w/o a space. Be careful not to end with a semicolon.

The directories that you just entered now will be added to sys.path whenever you open a interpreter, they won't replace it. Also, the changes will take place only after you've restarted the interpreter.


Source: http://greeennotebook.com/2010/06/how-to-change-pythonpath-in-windows-and-ubuntu/

answered May 14, 2012 at 14:54
Sign up to request clarification or add additional context in comments.

Comments

1

Perhaps this helps: It's a Guide to installing Python in Windows Vista.

answered Jan 16, 2009 at 12:37

Comments

1

Remember that in addition to setting PYTHONPATH in your system environment, you'll also want to assign DJANGO_SETTINGS_MODULE.

answered Jan 16, 2009 at 14:28

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.