appendix-a
Appendix A. Search and Optimization Libraries in Python
This appendix covers
- Setting up the Python environment
- Mathematical programming solvers
- Graph and mapping Libraries
- Metaheuristics Optimization Libraries
- Machine Learning Libraries
A.1 Setting up the Python environment
This book assumes that you already have Python 3.6 or newer installed on your system. For installation instructions specific to your operating system, see this Beginner’s Guide: https://wiki.python.org/moin/BeginnersGuide/. For Windows, you can follow these steps to install Python:
- Step 1: Go to the official website: https://www.python.org/downloads/
- Step 2: Select version of Python to install
- Step 3: Download Python executable installer
- Step 4: Run executable installer. Make sure you select the Install launcher for all users and Add Python 3.8 to PATH checkboxes.
- Step 5: Verify Python was successfully installed by typing python –V in a command prompt
- Step 6: Verify Pip was installed by typing pip -V in a command prompt
- Step 7: Install virtualnv by typing pip install virtualenv in a command prompt
If you are a Linux user, in the terminal, execute the following commands:
$ sudo apt update $ sudo apt install python3-pip
Install venv and create a python virtual environment:
$ sudo apt install python3.8-venv $ mkdir <new directory for venv> $ python -m venv <path to venv directory>