I installed python on mac os (mountain lion) with Macports.
When I run
$python
It gives an error on “cannot import urandom” when I try to import pandas or matplotlib.
If I run
$python 2.7
Everything runs perfectly.
I want to change python to use python2.7 always.
I tried using sudo port select python python27. But that didn’t help.
Please help me on this, I’m new to mac.
First let me preface by saying that OSX already comes with python installed. Lion and Mountain Lion have python2.7 as the system defaults.
Now assuming you really did want to use a macports version, my guess is that you only installed it, but didn’t do the step of modifying your
PATHto have it look first for macport installed executables…Installing MacPorts
~/.profileexport PATH=/opt/local/bin:/opt/local/sbin:$PATHThe next time you open a shell, it will place the macports install location at the front of your path, giving you access to the executables.