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.
-
What happens when you open a new terminal window and run `python`? Is your python version the new 2.6.6? – Cloud Artisans Jan 24 '11 at 14:52
3 Answers
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

- 8,580
- 4
- 34
- 32
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 ...

- 83,389
- 16
- 128
- 151
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?

- 1
- 1

- 1,158
- 1
- 8
- 16