When I made CaboCha usable with python3, I got stuck (Windows 10)

In order to use CaboCha with Python, I was proceeding with reference to "CaboCha & Python3 environment construction (Windows version)", but (4) I got stuck at the last setup.py of, so a memorandum of the solution

The quote source said to modify the source code of setup.py, but it didn't work for me. So, I modified setup.py by referring to the article "Windows 10-64bit using CaboCha with Python" and it worked. The following amendments that do not work and amendments that work

Proposed amendment that didn't work


#!/usr/bin/env python

from distutils.core import setup,Extension,os
import string

def cmd1(str):
    return os.popen(str).readlines()[0][:-1]

def cmd2(str):
    return cmd1(str).split()

setup(name = "cabocha-python",
    #↓ Fix as below version= cmd1("cabocha-config --version"),                
    py_modules=["CaboCha"],
    ext_modules = [
        Extension("_CaboCha",
            ["CaboCha_wrap.cxx",],
            include_dirs=[r"C:\Program Files (x86)\CaboCha\sdk"],
            library_dirs=[r"C:\Program Files (x86)\CaboCha\sdk"],
            libraries=cmd2("cabocha-config --libs-only-l"))
            ])

Successful fix


#!/usr/bin/env python

from distutils.core import setup,Extension,os
import string

def cmd1(str):
    return os.popen(str).readlines()[0][:-1]

def cmd2(str):
    return cmd1(str).split()

setup(name = "cabocha-python",
    version = "0.69",
    py_modules=["CaboCha"],
    ext_modules = [
        Extension("_CaboCha",
            ["CaboCha_wrap.cxx",],
            include_dirs=[r"C:\Program Files (x86)\CaboCha\sdk"],
            library_dirs=[r"C:\Program Files (x86)\CaboCha\sdk"],
            ##↓ Correct this part
            libraries=['libcabocha'])
])

Recommended Posts

When I made CaboCha usable with python3, I got stuck (Windows 10)
A reminder of what I got stuck when starting Atcoder with python
I made blackjack with python!
I made blackjack with Python.
I made wordcloud with Python.
When I tried to introduce python3 to atom, I got stuck
What I did when I got stuck in the time limit with lambda python
I made a fortune with Python.
I got stuck when trying to specify a relative path with relative_to () in python
I made a daemon with Python
I made a character counter with Python
I made a Hex map with Python
I made a roguelike game with Python
I made a simple blackjack with Python
I made a configuration file with Python
I made a neuron simulator with Python
I got an error when saving with OpenCV
I made a competitive programming glossary with Python
I made a weather forecast bot-like with Python.
I made a GUI application with Python + PyQt5
I made a Twitter fujoshi blocker with Python ①
[Python] I made a Youtube Downloader with Tkinter.
I got stuck installing Anaconda 4.3.0 which became Python 3.6
I made a bin picking game with Python
I made a Mattermost bot with Python (+ Flask)
I got an error when I put opencv in python3 with Raspberry Pi [Remedy]
A story that I was addicted to when I made SFTP communication with python
Python starting with Windows 7
When I tried to use Python on WSL (windows subsystem for linux), it got stuck in Jupyter (solved)
I made a Twitter BOT with GAE (python) (with a reference)
I made a Christmas tree lighting game with Python
I made a net news notification app with Python
I made a Python3 environment on Ubuntu with direnv.
I made a LINE BOT with Python and Heroku
I got an error when using Tensorboard with Pytorch
A story that stumbled when I made a chatbot with Transformer
I tried fp-growth with python
I tried scraping with Python
Python with VS Code (Windows 10)
I replaced the Windows PowerShell cookbook with a python script.
I got a Value Error when using JUMAN ++ with PyKNP
I made a simple typing game with tkinter in Python
Run python with PyCharm (Windows)
What I got stuck around GUI in WSL python environment
I made a package to filter time series with python
I made LINE-bot with Python + Flask + ngrok + LINE Messaging API
I made a simple book application with python + Flask ~ Introduction ~
5 reasons I got into Python
Error when playing with python
[I made it with Python] XML data batch output tool
I made a puzzle game (like) with Tkinter in Python
I made a python text
I ran python on windows
I tried gRPC with Python
I made COVID19_simulator with JupyterLab
I tried scraping with python
I made Word2Vec with Pytorch
Time synchronization (Windows) with Python
Othello made with python (GUI-like)
Life game with Python [I made it] (on the terminal & Tkinter)
I made a simple circuit with Python (AND, OR, NOR, etc.)