conflicting installations of python

A

azandi

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,
 
N

Ned Deily

azandi said:
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
 
A

azandi

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:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'urandom'
 
N

Ned Deily

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:

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top