代码之家  ›  专栏  ›  技术社区  ›  user51

尝试安装python语言服务器时出现“错误:命令'gcc'失败,退出状态为1”

  •  0
  • user51  · 技术社区  · 4 年前

        $ pip --version
        pip 19.3.1 from /usr/lib/python3.8/site-packages/pip (python 3.8)
    

    我的系统中安装的python版本是-

        $ python --version
        Python 3.8.3
    

    我正在尝试安装 python-language-server

    跑步设置.py为ujson安装。。。错误 命令:/usr/bin/python3-u-c'import sys,setuptools,tokenize;系统argv[0]='“'”/tmp/pip安装yoqmgayp/ujson/设置.py'"'"'; 文件 ='“'”'/tmp/pip安装yoqmgayp/ujson/设置.py“;f=getattr(标记化,”“open”“,open)( 文件 文件 ,“'”“'exec'”)'安装--record/tmp/pip-record-h4azsb93/install-记录.txt--外部管理的单一版本--编译 完整输出(16行): 警告:“classifiers”应为列表,获取类型“filter” 正在运行安装


    正在生成“ujson”扩展
    正在创建生成
    正在创建生成/临时linux-x86_64-3.8版本 正在创建生成/临时linux-x86_64-3.8/库 gcc-pthread-Wno unused result-Wsign compare-DDYNAMIC \u ANNOTATIONS \u ENABLED=1-DNDEBUG-O2-g-pipe-Wall-Werror=format security-Wp,-D \u FORTIFY \u SOURCE=2-Wp,-D\u GLIBCXX \u断言-fexceptions-fstack protector strong-grecord gcc switches-m64-mtune=generic-fasynchronous unwind tables-fstack clash protection-fcf protection-D\u GNU\u SOURCE-fPIC-fwrapv-O2-g-pipe-Wall-Werror=format security-Wp,-D\u fortfy\u SOURCE=2-Wp,-D\u GLIBCXX \u断言-fexceptions-fstack protector strong-grecord gcc switches-m64-mtune=generic-fasynchronous unwind tables-fstack clash protection-fcf protection-D\u GNU\u SOURCE-fPIC-fwrapv-O2-g-pipe-Wall-Werror=format security-Wp,-D\u fortfy\u SOURCE=2-Wp,-GLIBCXX断言-fexceptions-fstack protector strong-grecord gcc switches-m64-mtune=generic-fasynchronous unwind tables-fstack clash protection-fcf protection-D\u GNU\u SOURCE-fPIC-fwrapv-fPIC-I./python-I./lib-I/usr/include/python3.8-c./python/ujson.c-o build/临时linux-x86\u 64-3.8//python/ujson.o-D\u GNU\u源代码 在包含在./python/ujson.c:39中的文件中: ./python/py\u defines.h:39:10:致命错误:python.h:没有这样的文件或目录 | ^~~~~~~~~~ 编译已终止。


    错误:命令出错,退出状态为1:/usr/bin/python3-u-c'import sys,setuptools,tokenize;系统argv[0]='“'”/tmp/pip安装yoqmgayp/ujson/设置.py'"'"'; ='“'”'/tmp/pip安装yoqmgayp/ujson/设置.py“;f=getattr(标记化,”“open”“,open)( 文件 );code=f.read().replace('“\r\n'”,'“\n'”);f.close();exec(编译(代码, 文件 ,“'”“'exec'”)'安装--record/tmp/pip-record-h4azsb93/install-记录.txt--外部管理的单一版本——编译检查日志以获得完整的命令输出。

    下面是我的操作系统详细信息-

        $ lsb_release -a
        LSB Version:    :core-4.1-amd64:core-4.1-noarch
        Distributor ID: Fedora
        Description:    Fedora release 32 (Thirty Two)
        Release:        32
        Codename:       ThirtyTwo
    

    1 回复  |  直到 4 年前
        1
  •  0
  •   omajid    4 年前

    如果你读了message这个词,它会告诉你哪里不对

    ./python/py_defines.h:39:10: fatal error: Python.h: No such file or directory
    

    它说找不到头文件。询问 dnf

    sudo dnf provides '*/Python.h'
    

    sudo dnf install ... )然后重试原来的命令。