PYTHONPATH x *.pth???

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

    PYTHONPATH x *.pth???

    I want to install Python third packages in a
    non-default directory.
    What´s the better way?

    - PYTHONPATH variable?
    - *.pth files in site-packages?

    I know that the two methos above are equivalents. But
    what method will be keep in future Python releases
    (for example)?

    []´s

    Cadu


    _______________ _______________ ____
    Do you Yahoo!?
    Yahoo! SiteBuilder - Free, easy-to-use web site design software


  • Martin v. Löwis

    #2
    Re: PYTHONPATH x *.pth???

    Carlos Moreira wrote:
    [color=blue]
    > I want to install Python third packages in a
    > non-default directory.
    > What´s the better way?
    >
    > - PYTHONPATH variable?
    > - *.pth files in site-packages?[/color]

    It depends on your requirements. For example:

    - Why is it that you don't want to install the
    packages in the default directory? Then, considering
    that reason, why would it be acceptable to install
    a .pth file there?

    - Is it acceptable that users of your application set
    PYTHONPATH?

    - Do you have to consider multiple installations of Python

    And so on.

    You should also consider a third alternative:

    - Extend sys.path explicitly in the application,
    before importing the third package.
    [color=blue]
    > I know that the two methos above are equivalents. But
    > what method will be keep in future Python releases
    > (for example)?[/color]

    Both with be kept indefinitely.

    Regards,
    Martin

    Comment

    Working...