Installing PuLP on Mac OS X

2,333 views
Skip to first unread message

Ronald L. Rivest

unread,
Dec 14, 2010, 9:57:44 PM12/14/10
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

Stuart Mitchell

unread,
Dec 15, 2010, 4:20:08 PM12/15/10
to pulp-or...@googlegroups.com
Thanks very much for this.

Let me now if you ever make a version of cbc or coinMP for the mac as I would be happy to include these in the binary distributions of Pulp.

I will also update the documentation.

Stu



--
You received this message because you are subscribed to the Google Groups "pulp-or-discuss" group.
To post to this group, send email to pulp-or...@googlegroups.com.
To unsubscribe from this group, send email to pulp-or-discu...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/pulp-or-discuss?hl=en.


Sanam Sadr

unread,
Jun 9, 2016, 8:03:36 PM6/9/16
to pulp-or-discuss, rives...@gmail.com
Thanks Ron. I followed your second suggestion and it has been successful so far. Appreciate it.
Reply all
Reply to author
Forward
0 new messages