Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > conflicting installations of python

Reply
Thread Tools

conflicting installations of python

 
 
azandi
Guest
Posts: n/a
 
      09-12-2012
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,
 
Reply With Quote
 
 
 
 
Ned Deily
Guest
Posts: n/a
 
      09-13-2012
In article <(E-Mail Removed)>,
azandi <(E-Mail Removed)> 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,
http://www.velocityreviews.com/forums/(E-Mail Removed)

 
Reply With Quote
 
 
 
 
azandi@adconion.com
Guest
Posts: n/a
 
      09-13-2012
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 <(E-Mail Removed)>,
>
> azandi <(E-Mail Removed)> 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,
>
> (E-Mail Removed)


 
Reply With Quote
 
Ned Deily
Guest
Posts: n/a
 
      09-13-2012
In article <(E-Mail Removed)>,
(E-Mail Removed) 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,
(E-Mail Removed)

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple python installations mix their sys.prefix Tech Support Box Python 1 01-24-2011 12:19 PM
Fwd: Multiple python installations on opensuse? Ishwor Gurung Python 0 12-17-2009 11:27 AM
Re: Multiple python installations on opensuse? Ishwor Gurung Python 0 12-17-2009 11:01 AM
sys.path with multiple Python installations Xavier Lapointe Desjardins Python 0 03-05-2009 03:48 AM
Newbie question: Multiple installations of Python on Windows machines Don Taylor Python 5 02-22-2006 11:38 PM



Advertisments