Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8430925
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T05:43:05+00:00 2026-06-10T05:43:05+00:00

I installed python on mac os (mountain lion) with Macports. When I run $python

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T05:43:06+00:00Added an answer on June 10, 2026 at 5:43 am

    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 PATH to have it look first for macport installed executables…

    Installing MacPorts

    1. Edit your ~/.profile
    2. Add this line: export PATH=/opt/local/bin:/opt/local/sbin:$PATH

    The 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.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I installed matplotlib using the Mac disk image installer for MacOS 10.5 and Python
I have two versions of python installed on my mac running OSX Lion. The
I installed igraph for python in my mac but I can't import it. First
I've got various versions of python installed on my Mac using Macports. When I've
I have installed Python 3.2 on my Mac. After I run /Applications/Python 3.2/Update Shell
I compiled and installed pycrypto 2.6 on Mac OSX Lion with Python 3.2 but
I recently installed python 2.7.2 on my Mac running OSX 10.6.8. Previously, I had
I'm using virtualenv-1.4.5 on Mac OS X 10.6.2 (Xcode is installed) and Python 2.6.
I've installed the Mac OSX Python 2.7.3 , and tried switching to the new
First, I installed lxml without using pip (Python 2.7.2 on Mac OS 10.6.8). Then,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.