Issue with python-crfsuite

I have been trying to install Rasa X on Mac (Sierra 10.12.6) and running into various issues (Older Python, need to run 3.7.4 in virtualenv, missing gcc library, etc.) I have resolved all those issues and finally stuck at the below error:

bash: pip install --no-cache-dir python-crfsuite

Collecting python-crfsuite
  Downloading https://files.pythonhosted.org/packages/73/b5/d9640656386b28ca181410f292ffcc3f1c39d9438f0796f874fd5d65ee34/python-crfsuite-0.9.6.tar.gz (434kB)
     |████████████████████████████████| 440kB 3.3MB/s 
Building wheels for collected packages: python-crfsuite
  Building wheel for python-crfsuite (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: //miniconda3/envs/python3/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/1z/bsm__4d95sd084f4sp_gr0t40000gn/T/pip-install-l36yk9kb/python-crfsuite/setup.py'"'"'; __file__='"'"'/private/var/folders/1z/bsm__4d95sd084f4sp_gr0t40000gn/T/pip-install-l36yk9kb/python-crfsuite/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/1z/bsm__4d95sd084f4sp_gr0t40000gn/T/pip-wheel-v94f0tqi --python-tag cp37
       cwd: /private/var/folders/1z/bsm__4d95sd084f4sp_gr0t40000gn/T/pip-install-l36yk9kb/python-crfsuite/
  Complete output (25 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.macosx-10.9-x86_64-3.7
  creating build/lib.macosx-10.9-x86_64-3.7/pycrfsuite
  copying pycrfsuite/__init__.py -> build/lib.macosx-10.9-x86_64-3.7/pycrfsuite
  copying pycrfsuite/_dumpparser.py -> build/lib.macosx-10.9-x86_64-3.7/pycrfsuite
  copying pycrfsuite/_logparser.py -> build/lib.macosx-10.9-x86_64-3.7/pycrfsuite
  running build_ext
  building 'pycrfsuite._pycrfsuite' extension
  creating build/temp.macosx-10.9-x86_64-3.7
  creating build/temp.macosx-10.9-x86_64-3.7/pycrfsuite
  creating build/temp.macosx-10.9-x86_64-3.7/crfsuite
  creating build/temp.macosx-10.9-x86_64-3.7/crfsuite/lib
  creating build/temp.macosx-10.9-x86_64-3.7/crfsuite/lib/crf
  creating build/temp.macosx-10.9-x86_64-3.7/crfsuite/lib/crf/src
  creating build/temp.macosx-10.9-x86_64-3.7/crfsuite/swig
  creating build/temp.macosx-10.9-x86_64-3.7/crfsuite/lib/cqdb
  creating build/temp.macosx-10.9-x86_64-3.7/crfsuite/lib/cqdb/src
  creating build/temp.macosx-10.9-x86_64-3.7/liblbfgs
  creating build/temp.macosx-10.9-x86_64-3.7/liblbfgs/lib
  gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I//miniconda3/envs/python3/include -arch x86_64 -I//miniconda3/envs/python3/include -arch x86_64 -Icrfsuite/include/ -Icrfsuite/lib/cqdb/include -Iliblbfgs/include -Ipycrfsuite -I//miniconda3/envs/python3/include/python3.7m -c pycrfsuite/_pycrfsuite.cpp -o build/temp.macosx-10.9-x86_64-3.7/pycrfsuite/_pycrfsuite.o -std=c99
  error: invalid argument '-std=c99' not allowed with 'C++/ObjC++'
  error: command 'gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for python-crfsuite
  Running setup.py clean for python-crfsuite
Failed to build python-crfsuite
Installing collected packages: python-crfsuite
  Running setup.py install for python-crfsuite ... error
    ERROR: Command errored out with exit status 1:
     command: //miniconda3/envs/python3/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/1z/bsm__4d95sd084f4sp_gr0t40000gn/T/pip-install-l36yk9kb/python-crfsuite/setup.py'"'"'; __file__='"'"'/private/var/folders/1z/bsm__4d95sd084f4sp_gr0t40000gn/T/pip-install-l36yk9kb/python-crfsuite/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/1z/bsm__4d95sd084f4sp_gr0t40000gn/T/pip-record-ehj8teif/install-record.txt --single-version-externally-managed --compile
         cwd: /private/var/folders/1z/bsm__4d95sd084f4sp_gr0t40000gn/T/pip-install-l36yk9kb/python-crfsuite/
    Complete output (25 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.9-x86_64-3.7
    creating build/lib.macosx-10.9-x86_64-3.7/pycrfsuite
    copying pycrfsuite/__init__.py -> build/lib.macosx-10.9-x86_64-3.7/pycrfsuite
    copying pycrfsuite/_dumpparser.py -> build/lib.macosx-10.9-x86_64-3.7/pycrfsuite
    copying pycrfsuite/_logparser.py -> build/lib.macosx-10.9-x86_64-3.7/pycrfsuite
    running build_ext
    building 'pycrfsuite._pycrfsuite' extension
    creating build/temp.macosx-10.9-x86_64-3.7
    creating build/temp.macosx-10.9-x86_64-3.7/pycrfsuite
    creating build/temp.macosx-10.9-x86_64-3.7/crfsuite
    creating build/temp.macosx-10.9-x86_64-3.7/crfsuite/lib
    creating build/temp.macosx-10.9-x86_64-3.7/crfsuite/lib/crf
    creating build/temp.macosx-10.9-x86_64-3.7/crfsuite/lib/crf/src
    creating build/temp.macosx-10.9-x86_64-3.7/crfsuite/swig
    creating build/temp.macosx-10.9-x86_64-3.7/crfsuite/lib/cqdb
    creating build/temp.macosx-10.9-x86_64-3.7/crfsuite/lib/cqdb/src
    creating build/temp.macosx-10.9-x86_64-3.7/liblbfgs
    creating build/temp.macosx-10.9-x86_64-3.7/liblbfgs/lib
    gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I//miniconda3/envs/python3/include -arch x86_64 -I//miniconda3/envs/python3/include -arch x86_64 -Icrfsuite/include/ -Icrfsuite/lib/cqdb/include -Iliblbfgs/include -Ipycrfsuite -I//miniconda3/envs/python3/include/python3.7m -c pycrfsuite/_pycrfsuite.cpp -o build/temp.macosx-10.9-x86_64-3.7/pycrfsuite/_pycrfsuite.o -std=c99
    error: invalid argument '-std=c99' not allowed with 'C++/ObjC++'
    error: command 'gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: //miniconda3/envs/python3/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/1z/bsm__4d95sd084f4sp_gr0t40000gn/T/pip-install-l36yk9kb/python-crfsuite/setup.py'"'"'; __file__='"'"'/private/var/folders/1z/bsm__4d95sd084f4sp_gr0t40000gn/T/pip-install-l36yk9kb/python-crfsuite/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/1z/bsm__4d95sd084f4sp_gr0t40000gn/T/pip-record-ehj8teif/install-record.txt --single-version-externally-managed --compile Check the logs for full command output.

Can I get some help?

Thanks,

Kumar

Hm, maybe this is helpful: error: invalid argument '-std=c99' not allowed with 'C++/ObjC++' · Issue #13 · huseinzol05/Malaya · GitHub

I am also getting error on installing this package and above mentioned solution is not helping.

hey @Prskriti, which OS you are using?

I am using MacOS @JiteshGaikwad

are you using conda or normal python?

I am using python version 3.6.8 @JiteshGaikwad

hey @Prskriti, try installing using this:

pip install git+git://github.com/kvinwang/python-crfsuite.git@fix69

Tried that also getting “ERROR: Command errored out with exit status 128: git clone -q git://github.com/kvinwang/python-crfsuite.git /private/var/folders/43/r_htnmgd5gn79h83b42rmpw40000gp/T/pip-req-build-40su7ptz” on terminal side.

hey @Prskriti, I had tried the same command it works for me, I have attached SS for your references:

image

Thanks for ur quick responses I was able to install python crfsuite package using command conda install -c conda-forge python-crfsuite