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 4038480
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T12:28:41+00:00 2026-05-20T12:28:41+00:00

A colleague of mine wants to use my python 2 code on his OS

  • 0

A colleague of mine wants to use my python 2 code on his OS X (10.6) machine. My code imports several built-in python packages, including Tkinter and shelve, and also uses third-party packages, including numpy, scipy, matplotlib, and ipython.

I’ve encountered a few problems with OS X’s built-in python. (IDLE doesn’t work, for example*). I suspect I should install a more recent version of python, and a different version of Tk.

My questions:

  1. Will having two different versions of python/Tk on the same machine cause problems?

  2. I would like to associate the terminal commands ‘python’, ‘ipython’, and ‘easy_install’ with the more recent version of python. How should I do this?

  3. When I install third-party packages like numpy using a .dmg file, how do I control which version of python numpy installs into?

  4. Is there a better way to do this?

If this process goes well, I’d consider adding OS X instructions to my code’s documentation, so I’d like to boil down this process to the simplest, most general approach.

*EDIT: Also, this

EDIT: Thank you everyone for the useful answers. My colleague tried MacPorts, which seems to work well, but has a few speedbumps. First we had to install Xcode from the system install disk. This is not a fast or lightweight install (several GB). Luckily we still had the disk! Once Xcode was installed, MacPorts was easy to install. Python and the python subpackages we needed were also easy to install, but he told me this installation took several hours. Presumably this delay is due to compilation? He had an easy time setting the MacPorts python as default. However, I think we have to change the ‘Python Launcher’ application by hand, this seems to still default to the system python.

Even though he has a working system now, I’m tempted to ask him to try one of the other solutions. I’m not sure all of my code’s potential users will tolerate a multi-hour, multi-gigabyte installation.

  • 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-05-20T12:28:41+00:00Added an answer on May 20, 2026 at 12:28 pm

    Using MacPorts, you can install python 2.6, 2.7, 3.1 and 3.2 at the same time, with their own packages, without ever touching the built-in python.

    numpy, scipy, matplotlib, and ipython are also available as ports for most of those python versions.

    Moreover, if you install the python_select port, you’ll be able:

    • to choose which one of those (plus the built-in python) is the “default” python;

    • to install python packages through easy_install/pip for the “selected” python, if they’re not available as ports.

    Add virtualenv to the mix, and you’ll have a very, very flexible Python development environment.

    As for your questions:

    Q1: with MacPorts, no. while not a frequent user, I’ve installed and used matplotlib in 2.6 and 2.7, switching between the two using python_select.

    Q2: easy_install, pip, ipython will be “linked” to the python they were installed by. (but see tip 1)

    Q3: it’s easier to install one of the py{26,27,xx}-numpy ports, or pip install numpy under your python_select’ed python.

    Q4: well, MacPorts is the best thing I know after APT on Debian/Ubuntu… 🙂

    Now, two tips if you try MacPorts:

    1. MacPorts cleanly installs ports separately from the OS X installation, in an /opt/local directory, and each python version is installed in a /opt/local/Library/Frameworks/Python.framework/Versions/{2.5,2.6,2.7,...} directory. Using python_select cleanly switch the “python” command using links. BUT… the Versions/{2.5,2.6,2.7,...}/bin directory, where python scripts are installed, is not added to the PATH. Just adding: export PATH=/opt/local/Library/Frameworks/Python.framework/Versions/Current/bin:$PATH to your ~/.profile will always give you direct access to the scripts installed for the selected python.

    2. to avoid bad surprises, I’ve added a echo Selected python is \"$(python_select -s)\" line to my ~/.profile, so I always know which is my currently selected python when opening a session… 🙂

    Regards,

    Georges

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

Sidebar

Related Questions

A colleague of mine is using a horrible source code editor that leaves strange
Hello I have a colleague of mine who is a procedural code developer and
A colleague of mine states that booleans as method arguments are not acceptable .
A colleague of mine and I have been discussing how to declare variables in
A colleague of mine recently got bitten badly by writing out of bounds to
the other day a colleague of mine stated that using static classes can cause
My colleague insists on explicitly specifying the namespace in code as opposed to using
A while ago a colleague of mine said something astonishing to me: he said
A colleague of mine uses a abomination text editor that routinely leaves comment blocks
I was helping out some colleagues of mine with an SQL problem. Mainly they

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.