Ronald L. Rivest
unread,Dec 14, 2010, 9:57:44 PM12/14/10Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to pulp-or-discuss
Hi --
I had some minor trouble installing PuLP on on Mac OS X (Snow Leopard
10.6.5) for Python 2.6. I'm reporting this here, so others may
benefit from this note, and/or offer improved advice.
Python on the Mac is somewhat complicated, since there is frequently
more than one version of Python installed (Apple has an older version
supplied, and everyone installs a newer one to use), and there is more
than one place where packages can go to, depending on whether you are
using setuptools, macports, easy_install, or whatever.
(1) I first tried to install pulp with easy_install.
This "worked" (ran successfully to completion), but then the package
was not found by "import" (the "module not found" error).
Eventually I figured out that pulp was installed in the path:
/Library/Python/2.6/site-packages/PuLP-1.4.7-py2.6.egg
which wasn't on my python path (i.e. not in sys.path when Python
started up).
Having found the path, it was then possible to work-around by
doing
sys.path.append("/Library/Python/2.6/site-packages/PuLP-1.4.7-
py2.6.egg")
as necessary, but that is just plain ugly.
(2) The second approach was to just download the PuLP-1.4.7 directory,
and run
sudo python setup.py install
which installed PulP in
/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/
python2.6/site-packages/PuLP-1.4.7-py2.6.egg
and added this path to the sys.path. Then everything worked fine.
An equivalent approach would probably be to give easy_install an
install directory as an option, but I didn't try that.
Hope this is helpful to others. Perhaps the configuration information
for easy_install can be adapted to work more smoothly on Mac OS X
somehow, but the above is workable...
Cheers,
Ron Rivest