default import path

Discussion in 'Python' started by Peter, Jul 28, 2003.

  1. Peter

    Peter Guest

    <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\python\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
     
    Peter, Jul 28, 2003
    #1
    1. Advertising

  2. Peter

    Fabien SK Guest

    Peter wrote:
    > <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\python\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.)


    Hi,

    I added this key in the registry:

    HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\2.2\PythonPath\Some_name

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

    Have a nice day
    Fabien
     
    Fabien SK, Jul 28, 2003
    #2
    1. Advertising

  3. Peter

    Peter Guest

    this quote is from Fabien SK of Mon, 28 Jul 2003 20:59 :
    > Peter wrote:
    >> <newbie question>
    >> How can I edit the default import path for Python under Windows?

    >
    > I added this key in the registry:
    > HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\2.2\PythonPath\Some_name


    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
     
    Peter, Jul 28, 2003
    #3
  4. Peter

    Peter Guest

    this quote is from GerritM of Tue, 29 Jul 2003 06:40 :
    > "Peter" <> schreef in bericht
    > news:...
    >> How can I edit the default import path for Python under Windows?
    >>
    >>

    > create a piddle.pth file in the main Python directory (c:\prog~1\python in
    > your case?), with the pathname of piddle as line of text in the file:
    > c:\prog~1\python\lib\site-packages\piddle
    > (check the last part, this is the directory on my machine)


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

    cheers

    Peter
     
    Peter, Jul 29, 2003
    #4
    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. Paul Opal
    Replies:
    12
    Views:
    1,002
    Paul Opal
    Oct 11, 2004
  2. JPractitioner
    Replies:
    13
    Views:
    20,235
    Roedy Green
    Feb 24, 2006
  3. Vitali Gontsharuk
    Replies:
    2
    Views:
    605
    Vitali Gontsharuk
    Aug 25, 2005
  4. Artur M. Piwko

    import/from import question

    Artur M. Piwko, Jun 29, 2003, in forum: Python
    Replies:
    1
    Views:
    896
    Peter Hansen
    Jul 2, 2003
  5. Jabba Laci

    import os or import os.path

    Jabba Laci, Sep 6, 2011, in forum: Python
    Replies:
    0
    Views:
    200
    Jabba Laci
    Sep 6, 2011
Loading...

Share This Page