

とりあえずshellをbashに変更しました。  
Flaskのファイルを実行したいのですが、うまく行きません。

追記：  
現状Pythonファイルを実行するとこのような感じになっています。

[code]

    import MeCab
    ModuleNotFoundError: No module named 'MeCab'
    
[/code]

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

[code]

    % pip3 install mecab
    Collecting mecab
    Could not find any downloads that satisfy the requirement mecab
    No distributions at all found for mecab
    
    % pip3 install mecab-python
    Collecting mecab-python
    Could not find any downloads that satisfy 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-flask/lib/python3.6/site-packages (10.0.1)
    % pip install mecab-python3
    Collecting mecab-python3
      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-externally-managed --compile --install-headers /home/sky--ward/.pyenv/versions/3.6.4/envs/3.6.4-flask/include/site/python3.6/mecab-python3:
        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/
    
[/code]


CC BY-SA 4.0
2018-07-08T00:44:46.500
45404
2018-07-12T03:29:38.357
2018-07-12T03:29:38.357
29216
29216
question
python flask mecab pip さくらインターネット
さくらレンタルサーバーにおけるPythonでのMeCabのimport方法


web上のいくつかの記事を見る限りでは`/usr/local/bin`以下にインストールされているようです。実際の環境でもbashに **切り替える前**
に`which mecab`でPATHを確認されてはどうでしょうか。


CC BY-SA 4.0
2018-07-08T04:46:52.130
45412
2018-07-08T04:46:52.130
3060
45404
answer