通过pip3安装pylibmc时出现错误,opensuse Tumbleweed distribution

Posted

技术标签:

【中文标题】通过pip3安装pylibmc时出现错误,opensuse Tumbleweed distribution【英文标题】:An error occurs when installing pylibmc via pip3, opensuse Tumbleweed distribution 【发布时间】:2021-12-28 06:05:14 【问题描述】:

您好,当我尝试使用 pip 在 openSUSE Tumbleweed 上安装 pylibmc 时,我收到以下错误:

 Using legacy 'setup.py install' for pylibmc, since package 'wheel' is not installed.
    Installing collected packages: pylibmc
        Running setup.py install for pylibmc ... error
        ERROR: Command errored out with exit status 1:
         command: /usr/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-fra8rwmu/pylibmc/setup.py'"'"'; __file__='"'"'/tmp/pip-install-fra8rwmu/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-9bik3uxl/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.8/pylibmc
             cwd: /tmp/pip-install-fra8rwmu/pylibmc/
        Complete output (24 lines):
        /tmp/pip-install-fra8rwmu/pylibmc/setup.py:98: DeprecationWarning: 'U' mode is deprecated
          with open("README.rst", "U", encoding="utf-8") as r:
        /tmp/pip-install-fra8rwmu/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/test.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/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/autoconf.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/__init__.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
        gcc -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-***-protection -Werror=return-type -g -DOPENSSL_LOAD_CONF -fwrapv -fno-semantic-interposition -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-***-protection -Werror=return-type -g -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-***-protection -Werror=return-type -g -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 'gcc': No such file or directory
        error: command 'gcc' failed with exit status 1
        ----------------------------------------
    ERROR: Command errored out with exit status 1: /usr/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-fra8rwmu/pylibmc/setup.py'"'"'; __file__='"'"'/tmp/pip-install-fra8rwmu/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-9bik3uxl/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.8/pylibmc Check the logs for full command output.

发行版刚刚安装

【问题讨论】:

【参考方案1】:

如果有人对解决方案感兴趣,那么您需要提供必要的包,即在我的情况下

zypper in python38-devel libmemcached-devel zlib-devel gcc

【讨论】:

以上是关于通过pip3安装pylibmc时出现错误,opensuse Tumbleweed distribution的主要内容,如果未能解决你的问题,请参考以下文章

安装 gevent 时出现 Libev 相关错误

Camtasia录制时出现video codec open failed错误的解决方法

安装 tesseract-ocr 时出现 gcc 错误

尝试在 Xampp 上安装 Invision 电源板时出现 PHP 错误

ubuntu安装时出现11:资源暂时不可用

pip/pip3国内源