PYTHONPATH unnecessary with PythonWin?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • r.e.s.

    PYTHONPATH unnecessary with PythonWin?

    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?
  • Jeff Epler

    #2
    Re: PYTHONPATH unnecessary with PythonWin?

    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

    Comment

    • John Roth

      #3
      Re: PYTHONPATH unnecessary with PythonWin?


      "r.e.s." <r.s@ZZmindspri ng.com> wrote in message
      news:gpGIb.1433 4$lo3.1830@news read2.news.pas. earthlink.net.. .[color=blue]
      > 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?[/color]

      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


      Comment

      • r.e.s.

        #4
        Re: PYTHONPATH unnecessary with PythonWin?

        "Jeff Epler" <jepler@unpytho nic.net> wrote ...[color=blue]
        > 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.[/color]

        I've created one folder for that purpose, namely
        C:\Python23\Lib \site-packages\MyProj ects
        and I put all my own modules in various subfolders of that one.
        It seems to work, but maybe I'm breaking some protocols?

        Comment

        • Tim Roberts

          #5
          Re: PYTHONPATH unnecessary with PythonWin?

          "r.e.s." <r.s@ZZmindspri ng.com> wrote:
          [color=blue]
          >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?[/color]

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

          HKEY_LOCAL_MACH INE\
          SOFTWARE\
          Python\
          PythonCore\
          2.3\
          PythonPath
          --
          - Tim Roberts, timr@probo.com
          Providenza & Boekelheide, Inc.

          Comment

          Working...