J
Ju Hui
is python search module by paths in sys.path?
how to change it manuallly?
how to change it manuallly?
Ju said:is python search module by paths in sys.path?
how to change it manuallly?
Ju said:yes, I mean I want change the sys.path value and save it for next
using.
I can change the value of sys.path, but I can't "save" it permanently.
There is no python_path environment on my pc, what the relationship
between it and the sys.path?
In Windows, at least, you can create the PYTHONPATH variable and assign
to it the paths of the directories you want Python to check for when
running a script.
Jarek said:John Salerno napisa³(a):
Setting Windows envvar by changing os.environ dict will work only for
processes running in the same environment (i.e. in the same shell session).
Bruno Desthuilliers said:Ju Hui a écrit :
Don't you guess ?
yes, I mean I want change the sys.path value and save it for next
using.
>
I can change the value of sys.path, but I can't "save" it permanently. No.
There is no python_path environment on my pc,
what the relationship
between it and the sys.path?
I meant actually adding the PYTHONPATH variable to the environment
variables list.
Ju Hui said:yes, we can change PYTHONPATH to add some path to sys.path value, but
how to remove item from sys.path?
That would beJu said:yes, we can change PYTHONPATH to add some path to sys.path value, but
how to remove item from sys.path?
Dennis said:You're looking at editing the Windows registry for that...
I just right-clicked on My Computer --> Properties --> Advanced -->
Environment Variables, and added a new one called PYTHONPATH. I don't
know if that edits the registry, but you don't *manually* have to edit
the registry if you do it that way...unless of course you aren't
supposed to be doing it that way! But it worked anyway.![]()
Dennis said:I may have gotten slightly confused -- I had an impression that, at
least one poster in the thread, wanted to do this from within a Python
program. That does go into registry modifications.
For example, look at the entries under:
(system environment, I believe)
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session
Manager\Environment
(user specific environment)
HKEY_CURRENT_USER\Environment
Though in the case of PYTHONPATH, the core value seems to be in (for
my install)
HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\2.3\PythonPath
which also has subkeys for Pythonwin, win32, and win32com
That's my job.![]()
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.