IMPORT METHOD OF MECab IN Python IN Sakura RENTAL SERVER

Asked 2 years ago, Updated 2 years ago, 113 views

I changed the shell to bash for now.
I want to run the Flask file, but it doesn't work.

Note:
This is what it looks like when you run the Python file.

import MeCab
ModuleNotFoundError: No module named 'MeCab'

type mecab:mecab is/usr/local/bin/mecab
which mecab:/usr/local/bin/mecab

%pip3 install mecab
Collecting mecab
Could not find any downloads that satify the requirement mecab
No distributions at all found for mecab

% pip3 install mecab-python
Collecting mecab-python
Could not find any downloads that satify the requirement mecab-python
No distributions at all found for mecab-python


% pip install --upgrade pip
Requirement already up-to-date: pip in./.pyenv/versions/3.6.4/envs/3.6.4-flash/lib/python 3.6/site-packages (10.0.1)
% pip install mecab-python3
Collecting mecab-python 3
  Using cached https://files.pythonhosted.org/packages/25/e9/bbf5fc790a2bedd96fbaf47a84afa060bfb0b3e0217e5f64b32bd4bbad69/mecab-python3-0.7.tar.gz
Installing collected packages: mecab-python3
  Running setup.py install for mecab-python3 ... error
    Complete output from command /home/sky--ward/.pyenv/versions/3.6.4/envs/3.6.4-flask/bin/python -u -c "import setuptools, tokenize;__file__='/home/sky--ward/tmp/pip-install-vcj90d0h/mecab-python3/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /home/sky--ward/tmp/pip-record-g6zmjjvw/install-record.txt --single-version-external-managed --compile --install-headers/home/sky --ward/.pyenv/versions/3.6.4/envs/3.6.4-flash/include/site/python/methon.3:python-3
    running install
    running build
    running build_py
    creating build
    creating build/lib.freebsd-9.1-RELEASE-p24-amd64-3.6
    copying MeCab.py -> build/lib.freebsd-9.1-RELEASE-p24-amd64-3.6
    running build_ext
    building '_MeCab' extension
    creating build/temp.freebsd-9.1-RELEASE-p24-amd64-3.6
    gcc -pthread -fno-strict-aliasing -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/local/include -I/home/sky--ward/.pyenv/versions/3.6.4/envs/3.6.4-flask/include -I/home/sky--ward/.pyenv/versions/3.6.4/include/python3.6m -c MeCab_wrap.cxx -o build/temp.freebsd-9.1-RELEASE-p24-amd64-3.6/MeCab_wrap.o
    cc1plus: warning: command line option "-Wstrict-prototypes" is valid for C/ObjC but not for C++
    MeCab_wrap.cxx: In function 'PyObject* _wrap_Lattice_set_result(PyObject*, PyObject*)':
    MeCab_wrap.cxx:5583: error: 'class MeCab::Lattice' has no member named 'set_result'
    error: command 'gcc' failed with exit status 1

----------------------------------------
Command "/home/sky--ward/.pyenv/versions/3.6.4/envs/3.6.4-flask/bin/python -u -c "import setuptools, tokenize;__file__='/home/sky--ward/tmp/pip-install-vcj90d0h/mecab-python3/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /home/sky--ward/tmp/pip-record-g6zmjjvw/install-record.txt --single-version-externally-managed --compile --install-headers /home/sky--ward/.pyenv/versions/3.6.4/envs/3.6.4-flask/include/site/python3.6/mecab-python3" failed with error code 1 in /home/sky--ward/tmp/pip-install-vcj90d0h/mecab-python3/

python flask mecab pip sakura-internet-corporation

2022-09-29 22:56

1 Answers

As far as some articles on the web are concerned, they seem to be installed below /usr/local/bin.Why don't you check PATH with which mecab before switching to bash in your real environment?


2022-09-29 22:56

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.