Closed - Pip install pylibmc - doesn't work

Hi

I tried to install Seafile CE 9.0.4 on a fresh Ubuntu 20.04 installation.

I tried to use the script from the website.

When it comes down to install pylibmc, I get all sorts of error messages.
It’s probably not really Seafile related, but can one think of a solution for this issue?

root@Cloud ~ # pip install pylibmc
Collecting pylibmc
  Using cached pylibmc-1.6.1.tar.gz (64 kB)
Building wheels for collected packages: pylibmc
  Building wheel for pylibmc (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-7nes17_m/pylibmc/setup.py'"'"'; __file__='"'"'/tmp/pip-install-7nes17_m/pylibmc/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-kcy32ob7
       cwd: /tmp/pip-install-7nes17_m/pylibmc/
  Complete output (24 lines):
  /tmp/pip-install-7nes17_m/pylibmc/setup.py:98: DeprecationWarning: 'U' mode is deprecated
    with open("README.rst", "U", encoding="utf-8") as r:
  /tmp/pip-install-7nes17_m/pylibmc/setup.py:100: DeprecationWarning: 'U' mode is deprecated
    with open("src/pylibmc-version.h", "U", encoding="utf-8") as r:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.8
  creating build/lib.linux-x86_64-3.8/pylibmc
  copying src/pylibmc/__init__.py -> build/lib.linux-x86_64-3.8/pylibmc
  copying src/pylibmc/pools.py -> build/lib.linux-x86_64-3.8/pylibmc
  copying src/pylibmc/__main__.py -> build/lib.linux-x86_64-3.8/pylibmc
  copying src/pylibmc/consts.py -> build/lib.linux-x86_64-3.8/pylibmc
  copying src/pylibmc/client.py -> build/lib.linux-x86_64-3.8/pylibmc
  copying src/pylibmc/test.py -> build/lib.linux-x86_64-3.8/pylibmc
  copying src/pylibmc/autoconf.py -> build/lib.linux-x86_64-3.8/pylibmc
  running build_ext
  building '_pylibmc' extension
  creating build/temp.linux-x86_64-3.8
  creating build/temp.linux-x86_64-3.8/src
  x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DUSE_ZLIB -I/usr/include/python3.8 -c src/_pylibmcmodule.c -o build/temp.linux-x86_64-3.8/src/_pylibmcmodule.o -fno-strict-aliasing -std=c99
  unable to execute 'x86_64-linux-gnu-gcc': No such file or directory
  error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for pylibmc
  Running setup.py clean for pylibmc
Failed to build pylibmc
Installing collected packages: pylibmc
    Running setup.py install for pylibmc ... error
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-7nes17_m/pylibmc/setup.py'"'"'; __file__='"'"'/tmp/pip-install-7nes17_m/pylibmc/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-da5rwugl/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.8/pylibmc
         cwd: /tmp/pip-install-7nes17_m/pylibmc/
    Complete output (24 lines):
    /tmp/pip-install-7nes17_m/pylibmc/setup.py:98: DeprecationWarning: 'U' mode is deprecated
      with open("README.rst", "U", encoding="utf-8") as r:
    /tmp/pip-install-7nes17_m/pylibmc/setup.py:100: DeprecationWarning: 'U' mode is deprecated
      with open("src/pylibmc-version.h", "U", encoding="utf-8") as r:
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.8
    creating build/lib.linux-x86_64-3.8/pylibmc
    copying src/pylibmc/__init__.py -> build/lib.linux-x86_64-3.8/pylibmc
    copying src/pylibmc/pools.py -> build/lib.linux-x86_64-3.8/pylibmc
    copying src/pylibmc/__main__.py -> build/lib.linux-x86_64-3.8/pylibmc
    copying src/pylibmc/consts.py -> build/lib.linux-x86_64-3.8/pylibmc
    copying src/pylibmc/client.py -> build/lib.linux-x86_64-3.8/pylibmc
    copying src/pylibmc/test.py -> build/lib.linux-x86_64-3.8/pylibmc
    copying src/pylibmc/autoconf.py -> build/lib.linux-x86_64-3.8/pylibmc
    running build_ext
    building '_pylibmc' extension
    creating build/temp.linux-x86_64-3.8
    creating build/temp.linux-x86_64-3.8/src
    x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DUSE_ZLIB -I/usr/include/python3.8 -c src/_pylibmcmodule.c -o build/temp.linux-x86_64-3.8/src/_pylibmcmodule.o -fno-strict-aliasing -std=c99
    unable to execute 'x86_64-linux-gnu-gcc': No such file or directory
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-7nes17_m/pylibmc/setup.py'"'"'; __file__='"'"'/tmp/pip-install-7nes17_m/pylibmc/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-da5rwugl/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.8/pylibmc Check the logs for full command output.

Actually I now found the solution under this link:

I had to install the following to fix the error message:

sudo apt install python3-dev
sudo apt install build-essential