首页 > 解决方案 > 在 WSL2 (Ubuntu) 上安装 PyStemmer 时出错

问题描述

我想澄清一下我是 linux 的菜鸟

您好,科技之神!

我想在 WSL2 (LINUX) 上安装 PyStemmer 但我遇到了这个错误。

    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-xdkteqvb/pystemmer/setup.py'"'"'; __file__='"'"'/tmp/pip-install-xdkteqvb/pystemmer/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-7ar3x6pr/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/palash/.local/include/python3.8/PyStemmer
         cwd: /tmp/pip-install-xdkteqvb/pystemmer/
    Complete output (15 lines):
    running install
    running build
    running build_ext
    skipping 'src/Stemmer.c' Cython extension (up-to-date)
    building 'Stemmer' extension
    creating build
    creating build/temp.linux-x86_64-3.8
    creating build/temp.linux-x86_64-3.8/src
    creating build/temp.linux-x86_64-3.8/libstemmer_c
    creating build/temp.linux-x86_64-3.8/libstemmer_c/src_c
    creating build/temp.linux-x86_64-3.8/libstemmer_c/runtime
    creating build/temp.linux-x86_64-3.8/libstemmer_c/libstemmer
    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 -Isrc -Ilibstemmer_c/include -I/usr/include/python3.8 -c src/Stemmer.c -o build/temp.linux-x86_64-3.8/src/Stemmer.o
    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-xdkteqvb/pystemmer/setup.py'"'"'; __file__='"'"'/tmp/pip-install-xdkteqvb/pystemmer/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-7ar3x6pr/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/palash/.local/include/python3.8/PyStemmer Check the logs for full command output.

所以有些历史。首先它告诉“没有名为 Cython 的模块”,这很容易做到,仅此而已python3 -m pip install cython

(安装时 Pip 不在 PATHWARNING: The scripts pip, pip3 and pip3.8 are installed in '/home/palash/.local/bin' which is not on PATH. Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.消息中

我不知道发生了什么,所以请帮忙!

一些教程告诉我在 Linux 上做,我不想安装整个 linux 发行版。评论中有人说 WSL2 对他有用

谢谢你!

标签: pythonpython-3.xlinuxpipwsl-2

解决方案


推荐阅读