conflicting installations of python

Discussion in 'Python' started by azandi, Sep 13, 2012.

  1. azandi

    azandi Guest

    I installed python 2.7.3 using macports on Lion, and used port select python python27. However python version still shows 2.7.1.

    Any ideas why is that happenning? And how to fix it?

    Thanks in advance,
     
    azandi, Sep 13, 2012
    #1
    1. Advertising

  2. azandi

    Ned Deily Guest

    In article <>,
    azandi <> wrote:

    > I installed python 2.7.3 using macports on Lion, and used port select python
    > python27. However python version still shows 2.7.1.
    >
    > Any ideas why is that happenning? And how to fix it?


    Macports installs its ports into a separate root. You need to ensure
    that the macports bin directory comes first on your shell search path;
    by default, it is /opt/local/bin. Try something like this:

    export PATH=/opt/local/bin:$PATH

    Otherwise, use an alias or an absolute path:

    /opt/local/bin/python

    --
    Ned Deily,
     
    Ned Deily, Sep 13, 2012
    #2
    1. Advertising

  3. azandi

    Guest

    Hi Ned,

    Thanks for your response, I think the path is fine, since which python outputs the location where macports should install python i.e. /opt/local/bin/python.

    also

    port list active | fgrep python
    python27 @2.7.3 lang/python27

    and

    port location python27

    Port python27 2.7.3_0 is installed as an image in:
    /opt/local/var/macports/software/python27/python27-2.7.3_0.darwin_11.x86_64.tbz2


    Another problem caused by this installation is that somehow it removes os.urandom module:

    >>> import os
    >>> os.urandom

    Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    AttributeError: 'module' object has no attribute 'urandom'


    On Wednesday, September 12, 2012 8:07:43 PM UTC-7, Ned Deily wrote:
    > In article <>,
    >
    > azandi <> wrote:
    >
    >
    >
    > > I installed python 2.7.3 using macports on Lion, and used port select python

    >
    > > python27. However python version still shows 2.7.1.

    >
    > >

    >
    > > Any ideas why is that happenning? And how to fix it?

    >
    >
    >
    > Macports installs its ports into a separate root. You need to ensure
    >
    > that the macports bin directory comes first on your shell search path;
    >
    > by default, it is /opt/local/bin. Try something like this:
    >
    >
    >
    > export PATH=/opt/local/bin:$PATH
    >
    >
    >
    > Otherwise, use an alias or an absolute path:
    >
    >
    >
    > /opt/local/bin/python
    >
    >
    >
    > --
    >
    > Ned Deily,
    >
    >
     
    , Sep 13, 2012
    #3
  4. azandi

    Ned Deily Guest

    In article <>,
    wrote:
    > Thanks for your response, I think the path is fine, since which python
    > outputs the location where macports should install python i.e.
    > /opt/local/bin/python.
    >
    > also
    >
    > port list active | fgrep python
    > python27 @2.7.3 lang/python27
    >
    > and
    >
    > port location python27
    >
    > Port python27 2.7.3_0 is installed as an image in:
    > /opt/local/var/macports/software/python27/python27-2.7.3_0.darwin_11.x86_64.tb
    > z2


    None of the above actually shows what is being executed when you type
    python. What is the output from the following commands?

    which python
    ls -l $(which python)
    python

    > Another problem caused by this installation is that somehow it removes
    > os.urandom module:
    >
    > >>> import os
    > >>> os.urandom

    > Traceback (most recent call last):
    > File "<stdin>", line 1, in <module>
    > AttributeError: 'module' object has no attribute 'urandom'


    Looks like you are using a broken Python installation.

    --
    Ned Deily,
     
    Ned Deily, Sep 13, 2012
    #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. Don Taylor
    Replies:
    5
    Views:
    616
    Don Taylor
    Feb 22, 2006
  2. Xavier Lapointe Desjardins

    sys.path with multiple Python installations

    Xavier Lapointe Desjardins, Mar 5, 2009, in forum: Python
    Replies:
    0
    Views:
    338
    Xavier Lapointe Desjardins
    Mar 5, 2009
  3. Ishwor Gurung
    Replies:
    0
    Views:
    520
    Ishwor Gurung
    Dec 17, 2009
  4. Ishwor Gurung
    Replies:
    0
    Views:
    953
    Ishwor Gurung
    Dec 17, 2009
  5. Tech Support Box
    Replies:
    1
    Views:
    494
    shrikant kesharwani
    Jan 24, 2011
Loading...

Share This Page