Home  >  Article  >  Backend Development  >  How to install cvxopt in python

How to install cvxopt in python

(*-*)浩
(*-*)浩Original
2019-06-25 13:54:194756browse

How to install cvxopt I tried many methods, and found some posts saying to install this and that, it was a mess, but later I found that it only takes three steps

First of all, I am using python3. 6. No matter what version of python you have, it actually doesn’t matter, as long as the installed cvxopt and numpy are suitable for your python version

How to install cvxopt in python

Step one: Be sure to uninstall your numpy first, use pip uninstall numpy (recommended learning: Python video tutorial)

If you want to uninstall from a DOS window: use python - m pip uninstall numpy

If you are installing anaconda, you can use it directly from the anaconda prompt window: pip uninstall numpy

Step 2: Download cvxopt The URL is https ://www.lfd.uci.edu/~gohlke/pythonlibs/

My version is 64-bit python3.6. So what I downloaded is: cvxopt-1.1.9-cp36-cp36m-win_amd64.whl

Then the installation is the same as the first step, use

pip install (the location where cvxopt is stored: this location is where the cvxopt you downloaded from the Internet is saved locally), Mine is D:\DevelopSoftWare\Anaconda\cvxopt-1.1.9-cp36-cp36m-win_amd64.whl

Because I am using the anaconda prompt window, so my command is pip install D:\DevelopSoftWare \Anaconda\cvxopt-1.1.9-cp36-cp36m-win_amd64.whl

If you want to install it using DOS, just add python -m in front of pip:

python -m pip install D:\DevelopSoftWare\Anaconda\cvxopt-1.1.9-cp36-cp36m-win_amd64.whl

Step 3: Install numpy, do not use the numpy you used before (this is a pitfall, before I thought it was necessary to uninstall numpy first, then install cvxopt, and finally install numpy. Many people on the Internet also said this. I thought it was related to the installation order. Later I found out that it had nothing to do with the installation order of cvxopt and numpy. It was numpy. problem),

It doesn’t matter the order of installing new numpy and installing cvxopt

Then use pip install (the location where numpy is stored: This location is where the numpy you downloaded from the Internet is saved locally) ,

Mine is D:\DevelopSoftWare\Anaconda\numpy-1.13.3 mkl-cp36-cp36m-win_amd64.whl

For more Python related technical articles, please visitPython tutorial column to learn!

The above is the detailed content of How to install cvxopt in python. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn