pythonlinuxnumpylinux-mintquadprog

Failed to install quadprog on Linux Mint 20


has anyone installed this quadprog lib on Python 3.8 and Linux Mint 20? I'm trying to install and the following error is appearing:

pip install quadprog
Collecting quadprog
  Using cached quadprog-0.1.8.tar.gz (269 kB)
Requirement already satisfied: Cython in ./anaconda3/lib/python3.8/site-packages (from quadprog) (0.29.21)
Building wheels for collected packages: quadprog
  Building wheel for quadprog (setup.py) ... [?25lerror
  ERROR: Command errored out with exit status 1:
   command: /home/hugosouza/anaconda3/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-8o_4txn2/quadprog_089e8c8a9afa4563849d61ace43b3f03/setup.py'"'"'; __file__='"'"'/tmp/pip-install-8o_4txn2/quadprog_089e8c8a9afa4563849d61ace43b3f03/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-r3kgatse
       cwd: /tmp/pip-install-8o_4txn2/quadprog_089e8c8a9afa4563849d61ace43b3f03/
  Complete output (12 lines):
  running bdist_wheel
  running build
  running build_ext
  skipping 'quadprog/quadprog.cpp' Cython extension (up-to-date)
  building 'quadprog' extension
  creating build
  creating build/temp.linux-x86_64-3.8
  creating build/temp.linux-x86_64-3.8/quadprog
  gcc -pthread -B /home/hugosouza/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Iquadprog -I/home/hugosouza/anaconda3/include/python3.8 -c quadprog/quadprog.cpp -o build/temp.linux-x86_64-3.8/quadprog/quadprog.o
  gcc: fatal error: cannot execute ‘cc1plus’: execvp: Arquivo ou diretório não encontrado
  compilation terminated.
  error: command 'gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for quadprog
nning setup.py clean for quadprog
Failed to build quadprog
^C
ERROR: Operation cancelled by user
Note: you may need to restart the kernel to use updated packages.

Solution

  • You need to install g++ or build-essential (which will install g++)

    apt-get install g++