Debian Codegraph @

INSTALL

raw
1 Installation
2 ------------
3
4 Note that to install PuLP you must first have a working python installation as
5 described in `installing python`_.
6
7 PuLP requires Python >= 2.7 or Python >= 3.4.
8
9 The latest version of PuLP can be freely obtained from github_.
10
11 Pip and pypi installation
12 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
13
14 By far the easiest way to install pulp is through the use of pip_.
15
16 * In windows (please make sure pip is on your path)::
17
18 c:\Python34\Scripts\> pip install pulp
19
20 * In Linux::
21
22 $ sudo pip install pulp
23 $ sudo pulptest #needed to get the default solver to work
24
25 * Then follow the instructions below to test your installation
26
27 To access the examples and pulp source code use the instructions below to install from source.
28
29
30 Windows installation from source
31 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
32
33 * Install python (`installing python`_)
34 * Download the `PuLP zipfile`_
35 * Extract the zipfile to a suitable location (such as the desktop: the folder will be no longer required after installation)
36
37 * Open a command prompt by clicking "Run" in the Start Menu, and type 'cmd' in the window and push enter.
38 * Navigate to the extracted folder with the setup file in it. [Do this by typing 'cd foldername' at the prompt, where 'cd' stands for current directory and the 'foldername' is the name of the folder to open in the path already listed to the left of the prompt. To return back to a root drive, type 'cd C:\']
39 * Type 'setup.py install' at the command prompt. This will install all the PuLP functions into Python's site-packages directory.
40
41 The PuLP function library is now able to be imported from any python command line. Go to IDLE or PyDev and type
42
43 >>> from pulp import *
44
45 to load in the functions. (You need to re-import the functions each time after you close the GUI) PuLP is written in a programming language called Python, and to use PuLP you must write Python code to describe your optimization problem.
46
47 Linux Installation
48 ~~~~~~~~~~~~~~~~~~
49
50 * Extract the `PuLP zipfile`_ folder to a suitable location (such as your home directory - the folder will be no longer required after installation)
51 * Open a command line navigate to the extracted zipfile with the setup file in it. [Do this by typing 'cd foldername' at the prompt]
52 * Type the following at the command prompt. This will install all the PuLP functions into Python's callable modules.
53
54 .. code-block:: sh
55
56 $ sudo python setup.py install
57
58 * install a solver for pulp to use either
59
60 * use the included 64 or 32-bit binaries cbc-32 and cbc-64
61 * install glpk_ debain based distributions may use the following
62
63 .. code-block:: sh
64
65 $ sudo apt-get install glpk-utils
66
67 * install gurobi_ (free academic licenses)
68 * install cplex_ (also a license for academics)
69
70 .. _glpk: http://www.gnu.org/software/glpk/
71 .. _CBC: https://projects.coin-or.org/Cbc
72 .. _cplex: http://cplex.com
73 .. _gurobi: http://gurobi.com
74
75 Testing your PuLP installation
76 ------------------------------
77 To test that that you pulp installation is working correctly please type the
78 following into a python interpreter and note that the output should be similar.
79 The output below is what you would expect if you have not installed any other
80 solvers and the CBC_ solver bundled with pulp works.
81
82 >>> import pulp
83 >>> pulp.pulpTestAll()
84 Testing zero subtraction
85 Testing continuous LP solution
86 Testing maximize continuous LP solution
87 Testing unbounded continuous LP solution
88 Testing Long Names
89 Testing repeated Names
90 Testing zero constraint
91 Testing zero objective
92 Testing LpVariable (not LpAffineExpression) objective
93 Testing Long lines in LP
94 Testing LpAffineExpression divide
95 Testing MIP solution
96 Testing MIP relaxation
97 Testing feasibility problem (no objective)
98 Testing an infeasible problem
99 Testing an integer infeasible problem
100 Testing column based modelling
101 Testing dual variables and slacks reporting
102 Testing fractional constraints
103 Testing elastic constraints (no change)
104 Testing elastic constraints (freebound)
105 Testing elastic constraints (penalty unchanged)
106 Testing elastic constraints (penalty unbounded)
107 * Solver pulp.solvers.PULP_CBC_CMD passed.
108 Solver pulp.solvers.CPLEX_DLL unavailable
109 Solver pulp.solvers.CPLEX_CMD unavailable
110 Solver pulp.solvers.CPLEX_PY unavailable
111 Solver pulp.solvers.COIN_CMD unavailable
112 Solver pulp.solvers.COINMP_DLL unavailable
113 Solver pulp.solvers.GLPK_CMD unavailable
114 Solver pulp.solvers.XPRESS unavailable
115 Solver pulp.solvers.GUROBI unavailable
116 Solver pulp.solvers.GUROBI_CMD unavailable
117 Solver pulp.solvers.PYGLPK unavailable
118 Solver pulp.solvers.YAPOSIB unavailable
119
120 .. _`installing python`: http://www.diveintopython.org/installing_python/index.html
121 .. _github: https://github.com/coin-or/pulp-or
122 .. _pip: https://pypi.python.org/pypi/pip
123 .. _`PuLP zipfile`: https://github.com/coi-nor/pulp-or/archive/master.zip
124