default import path

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Peter

    default import path


    <newbie question>
    How can I edit the default import path for Python under Windows?

    I want to use the piddle module. So far, I've copied the unzipped contents
    of the zip file to c:\prog~1\pytho n\lib\site-packages, but how do I set it
    so this is automatically on the python path?

    (I don't want to have to manually add that directory every time.)

    TIA

    Peter

  • Fabien SK

    #2
    Re: default import path

    Peter wrote:[color=blue]
    > <newbie question>
    > How can I edit the default import path for Python under Windows?
    >
    > I want to use the piddle module. So far, I've copied the unzipped contents
    > of the zip file to c:\prog~1\pytho n\lib\site-packages, but how do I set it
    > so this is automatically on the python path?
    >
    > (I don't want to have to manually add that directory every time.)[/color]

    Hi,

    I added this key in the registry:

    HKEY_LOCAL_MACH INE\SOFTWARE\Py thon\PythonCore \2.2\PythonPath \Some_name

    and I set the default value for this key to the new Path

    Have a nice day
    Fabien

    Comment

    • Peter

      #3
      Re: default import path

      this quote is from Fabien SK of Mon, 28 Jul 2003 20:59 :[color=blue]
      > Peter wrote:[color=green]
      >> <newbie question>
      >> How can I edit the default import path for Python under Windows?[/color]
      >
      > I added this key in the registry:
      > HKEY_LOCAL_MACH INE\SOFTWARE\Py thon\PythonCore \2.2\PythonPath \Some_name[/color]

      Thanks,
      seems rather un-python-like to have to do this via an edit to the registry.
      I'm comfortable editing config on my Linux PC, but I'd rather not mess with
      the registry as Windows is too frail (and it is a friend's PC).
      Maybe, it would be better to use a addpath statement in each python script
      where I want to use this module.

      thanks for you help

      Peter

      Comment

      • Peter

        #4
        Re: default import path

        this quote is from GerritM of Tue, 29 Jul 2003 06:40 :[color=blue]
        > "Peter" <nospamjynyl@ya hoo.co.nz> schreef in bericht
        > news:3f24c37e@n ews.maxnet.co.n z...[color=green]
        >> How can I edit the default import path for Python under Windows?
        >>
        >>[/color]
        > create a piddle.pth file in the main Python directory (c:\prog~1\pyth on in
        > your case?), with the pathname of piddle as line of text in the file:
        > c:\prog~1\pytho n\lib\site-packages\piddle
        > (check the last part, this is the directory on my machine)[/color]

        Thanks!
        I'll check it out next time I get to a machine running Windows.

        cheers

        Peter

        Comment

        Working...