I want to handle optimization with python and cplex

Introduction

This is written for students who want to work with solvers using python. (It doesn't mention how to use CPLEX itself, so if you want it, please back to Google.)

What is CPLEX

Simply put, it's a ** paid solver **.

CPLEX is a commercial mathematical optimization software provided by IBM. (Academic version is free)

It is an optimization solver provided by IBM. Students can use it for free. It seems that the student version could not be downloaded for a while, but now it can be done (2019.12.15 information) You can create one account with one academic email address, and you can download and install it only once for each account. Download it carefully.

Preparation on windows

Here is the point that I personally stumbled upon. If you use Cplex in Python. For Python, please install ** 3.6 ** or ** 3.7 ** of ** 64bit version **. Since the windows compatible version of cplex is 64bit, for some reason it works well up to convert.py in the next section. At the time of pip list, the notation is firmly cplex, but

import cplex

I get an error.

The error is

%1 is not a valid win32 application

I think it was.

Download CPLEX

Cplex is originally a paid version, but you can install it by creating a student account. I installed it referring to here. [Student version] I didn't have much information about the installation procedure of CPLEX, so I wrote it A few years ago, I didn't know if I could put in IBM Download Director ...? ?? Impression that ...

Apply as Python library

The folder structure of cplex is like this (partial excerpt) C: \ Program Files \ IBM \ ILOG \ CPLEX_Studio1210 \ The following part. cplexフォルダ構成.png Be careful (stuck) because there are a lot of setup.py in the configuration When introducing cplex, either of the above figures must be executed. For python3.7, execute setup.py under directory 3.7.

 >>> python setup.py install

When finished, display the pip list to confirm that cplex is registered as a library.

Reference site: Call Cplex from Python

Once you're done, check the import cplex with python in the terminal.

Recommended Posts

I want to handle optimization with python and cplex
I want to debug with Python
I want to analyze logs with Python
I want to play with aws with python
I want to solve APG4b with Python (only 4.01 and 4.04 in Chapter 4)
I want to make a game with Python
I want to use Temporary Directory with Python2
#Unresolved I want to compile gobject-introspection with Python3
I want to solve APG4b with Python (Chapter 2)
I want to write to a file with Python
I want to inherit to the back with python dataclass
I want to work with a robot in python.
I want to AWS Lambda with Python on Mac!
[ML Ops] I want to do multi-project with Python
I want to run a quantum computer with Python
I played with PyQt5 and Python3
I want to do ○○ with Pandas
I want to be able to analyze data with Python (Part 3)
I want to specify another version of Python with pyvenv
I want to be able to analyze data with Python (Part 1)
I want to be able to analyze data with Python (Part 4)
I want to be able to analyze data with Python (Part 2)
I want to automatically attend online classes with Python + Selenium!
[Python] I want to use the -h option with argparse
I want to know the features of Python and pip
I tried to make GUI tic-tac-toe with Python and Tkinter
I want to detect objects with OpenCV
I want to use a wildcard that I want to shell with Python remove
I want to know the weather with LINE bot feat.Heroku + Python
I want to monitor UNIQLO + J page updates [Scraping with python]
I want to blog with Jupyter Notebook
I want to handle the rhyme part3
Fractal to make and play with Python
I want to output the beginning of the next month with Python
I want to use jar from python
I wanted to solve ABC160 with Python
I want to build a Python environment
I want to pip install with PythonAnywhere
I want to do a full text search with elasticsearch + python
I want to improve efficiency with Python even in an experimental system (2) RS232C and pySerial
I tried to make a periodical process with Selenium and Python
I want to use both key and value of Python iterator
Trying to handle SQLite3 with Python [Note]
I installed and used Numba with Python3.5
[Introduction] I want to make a Mastodon Bot with Python! 【Beginners】
I tried to easily detect facial landmarks with python and dlib
I wanted to solve ABC172 with Python
I want to handle the rhyme part2
I want to make a voice changer using Python and SPTK with reference to a famous site
I want to handle the rhyme part5
I want to handle the rhyme part4
I want to do it with Python lambda Django, but I will stop
I want to tweet on Twitter with Python, but I'm addicted to it
Environment maintenance made with Docker (I want to post-process GrADS in Python
I want to format and check Python code to my liking on VS Code
I want to make a web application using React and Python flask
I want to do Dunnett's test in Python
Scraping tabelog with python and outputting to CSV
MessagePack-Try to link Java and Python with RPC
I want to analyze songs with Spotify API 2
I wanted to solve NOMURA Contest 2020 with Python