0

I've installed py26 using macports. I want to install a separate module that isn't on Macports. It gets installed in to my default OSX installation. How do I point my install to my macport installation.

Alan Quigley
  • 1,642
  • 2
  • 15
  • 19

3 Answers3

0

Put py26 on your path. In your .bash_profile for instance this should work

export PATH=/opt/local/bin:/opt/local/sbin:$PATH

don't forget to source at the end from the commandline

. ~/.bash_profile
Navi
  • 8,580
  • 4
  • 34
  • 32
0

First make sure your PATH is set up properly for MacPorts Python. You need to ensure that the Python framework bin directory is on it along with the normal MacPorts bin directories:

$ export PATH=opt/local/Library/Frameworks/Python.framework/Versions/2.6/bin:/opt/local/bin:/opt/local/sbin:$PATH

If the package is installed by running a command like python setup.py ... then you should be all set. You could be extra sure by using an absolute path to the MacPorts Python:

 $ sudo /opt/local/bin/python2.6 setup.py ...

If the package is installed with an easy_install command, make sure you have installed a version of easy_install for the MacPorts Python. The simplest way to do that:

 $ sudo port install py26-distribute  # setuptools replacement, provides easy_install
 $ sudo /opt/local/bin/easy_install-2.6 ...
Ned Deily
  • 83,389
  • 16
  • 128
  • 151
0

Install the "python_select" port. It will then be easier for you to install packages for your selected python version.

See the discussion in What is the best way to install python 2 on OS X?

Community
  • 1
  • 1
Georges Martin
  • 1,158
  • 1
  • 8
  • 16