Windows Python3 install cvxpy

Article directory

method 1

  When installing, you can first try to install directly using pip3. If it fails, then use method 2.

pip3 install cvxpy

  I reported an error after installing it on my own computer. After looking at the main reasons for the error, I found the following:

  • Missing dependency scs

Running setup.py install for scs … error
ERROR: Command errored out with exit status 1:

  • Missing dependency cvxopt

Running setup.py install for cvxopt… error
ERROR: Command errored out with exit status 1:

  • Missing dependency mkl

Running setup.py install for mkl… error
ERROR: Command errored out with exit status 1:

Therefore, before installation, you need to install the dependencies first. The main dependencies are as follows:

pip3 install numpy mkl scipy cvxopt scs ecos osqp 

Method 2

If an error occurs during the installation of a certain package, you need to download the corresponding .whl file yourself and use pip3 to install the downloaded specified file. Take ecos as an example:

  1. Download the package:
    Open the URL, https://www.lfd.uci.edu/~gohlke/pythonlibs/, search for ecos, and download the corresponding package. Here I am using python3.9+amd64, so download ecos‑2.0.7.post1‑cp39‑cp39‑win_amd64.whl
  2. Open cmd installation
    pip3 install xxx/xxx/xxx/ecos‑2.0.7.post1‑cp39‑cp39‑win_amd64.whl
    
    Just replace the xxx/xxx/xxx here with the address where you downloaded the file.

Guess you like

Origin blog.csdn.net/qq_16775293/article/details/117560931