How to import modules from specific Python installation?

Discussion in 'Python' started by kk, Apr 26, 2009.

  1. kk

    kk Guest

    Hi

    I know there is a way to import from different Python installation but
    I could not find the answer. I have Python 2.6 and 2.5


    thanks
     
    kk, Apr 26, 2009
    #1
    1. Advertising

  2. kk

    Dave Angel Guest

    kk wrote:
    > Hi
    >
    > I know there is a way to import from different Python installation but
    > I could not find the answer. I have Python 2.6 and 2.5
    >
    >
    > thanks
    >
    >

    There's always the question of whether it's a good idea. My opinion is
    that if you want to use python source files from another version, you
    should *copy* them into your present version's syspath, and import them
    as a 3rd party site-package. So it's a question of putting it in the
    site-packages directory and adding a __init__.py file.

    Alternatively, you can modify the sys.path, import it, then restore the
    sys.path. With that hack, you can do anything.
     
    Dave Angel, Apr 26, 2009
    #2
    1. Advertising

  3. kk

    David Lyon Guest

    Re: How to import modules from specific Pythoninstallation?

    On Sun, 26 Apr 2009 13:07:24 -0700 (PDT), kk <> wrote:
    > I know there is a way to import from different Python installation but
    > I could not find the answer. I have Python 2.6 and 2.5


    You can probably achieve this by adjusting the pythonpath to
    search through the site-packages directory of the other installation.

    David
     
    David Lyon, Apr 27, 2009
    #3
  4. kk

    kk Guest

    Hi


    Thank you for the suggestions, I will see what I can from here.
     
    kk, Apr 27, 2009
    #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. Jon Paugh
    Replies:
    1
    Views:
    343
    Craig Deelsnyder
    Jan 6, 2004
  2. Remy Cool
    Replies:
    1
    Views:
    437
    Remy Cool
    Aug 27, 2003
  3. Jon Moldover
    Replies:
    0
    Views:
    305
    Jon Moldover
    Oct 28, 2003
  4. ssecorp
    Replies:
    14
    Views:
    766
    Fredrik Lundh
    Sep 10, 2008
  5. Brendan Miller

    install modules for specific python version

    Brendan Miller, Feb 1, 2009, in forum: Python
    Replies:
    1
    Views:
    346
    John Machin
    Feb 1, 2009
Loading...

Share This Page