PYTHONPATH unnecessary with PythonWin?

Discussion in 'Python' started by r.e.s., Dec 31, 2003.

  1. r.e.s.

    r.e.s. Guest

    I have no PYTHONPATH nor any other python-related environment
    variables, yet everything seems fine. (I'm using PythonWin
    with winxp.) As long as modules are loaded through PythonWin,
    is PYTHONPATH unnecessary? Or am I missing something?
    r.e.s., Dec 31, 2003
    #1
    1. Advertising

  2. r.e.s.

    Jeff Epler Guest

    Python searches some directories by default. The documentation probably
    describes this in more detail. Using PYTHONPATH, you can
    add to that list. For instance, it's often useful (particularly on
    Unix) to have a personal directory listed in PYTHONPATH (like
    ~/lib/python) for your own modules.

    Jeff
    Jeff Epler, Dec 31, 2003
    #2
    1. Advertising

  3. r.e.s.

    John Roth Guest

    "r.e.s." <> wrote in message
    news:gpGIb.14334$...
    > I have no PYTHONPATH nor any other python-related environment
    > variables, yet everything seems fine. (I'm using PythonWin
    > with winxp.) As long as modules are loaded through PythonWin,
    > is PYTHONPATH unnecessary? Or am I missing something?


    sys.path is initialized to automatically provide access to the
    standard parts of the Python installation; it is not necessary
    to have a PYTHONPATH environment variable for this.
    You can also stick things in sys.path with a foo.pth file.
    It's only when you want to get outside of the standard libraries
    that you need the PYTHONPATH environment variable.

    Since I'm running Windows, I don't have "a" command line,
    I have one for each project, and I simply initialize PYTHONPATH
    in the command line startup for what I need for that project.

    John Roth
    John Roth, Dec 31, 2003
    #3
  4. r.e.s.

    r.e.s. Guest

    "Jeff Epler" <> wrote ...
    > Python searches some directories by default. The documentation probably
    > describes this in more detail. Using PYTHONPATH, you can
    > add to that list. For instance, it's often useful (particularly on
    > Unix) to have a personal directory listed in PYTHONPATH (like
    > ~/lib/python) for your own modules.


    I've created one folder for that purpose, namely
    C:\Python23\Lib\site-packages\MyProjects
    and I put all my own modules in various subfolders of that one.
    It seems to work, but maybe I'm breaking some protocols?
    r.e.s., Dec 31, 2003
    #4
  5. r.e.s.

    Tim Roberts Guest

    "r.e.s." <> wrote:

    >I have no PYTHONPATH nor any other python-related environment
    >variables, yet everything seems fine. (I'm using PythonWin
    >with winxp.) As long as modules are loaded through PythonWin,
    >is PYTHONPATH unnecessary? Or am I missing something?


    On Windows, the initial value of PYTHONPATH is stored in the registry:

    HKEY_LOCAL_MACHINE\
    SOFTWARE\
    Python\
    PythonCore\
    2.3\
    PythonPath
    --
    - Tim Roberts,
    Providenza & Boekelheide, Inc.
    Tim Roberts, Jan 2, 2004
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dominik Jain
    Replies:
    9
    Views:
    8,495
    Dominik Jain
    Aug 4, 2005
  2. Steffen Beyer
    Replies:
    3
    Views:
    747
    Richard Tobin
    Nov 2, 2004
  3. Richard Clarke
    Replies:
    2
    Views:
    334
    Bob Hairgrove
    Oct 18, 2004
  4. belief
    Replies:
    3
    Views:
    347
    msalters
    May 9, 2005
  5. stephan
    Replies:
    0
    Views:
    427
    stephan
    Jul 30, 2003
Loading...

Share This Page