Repository: espnet/espnet

Issue:
ctc-segmentation installation is failed with pip in colab
Recently `ctc-segmentation` is addded in requirements (#2301).
However, this causes the error in the installation with pip in colab.
(You can reproduce in [this notebook](https://colab.research.google.com/github/espnet/notebook/blob/master/espnet2_tts_realtime_demo.ipynb).)
This affects the demo notebook so I want to fix it as soon as possible.

@lumaku Could you check it?

```bash
!pip install -vvv ctc-segmentation
```

```bash
Created temporary directory: /tmp/pip-ephem-wheel-cache-334qq_lm
Created temporary directory: /tmp/pip-req-tracker-dwauuihb
Created requirements tracker '/tmp/pip-req-tracker-dwauuihb'
Created temporary directory: /tmp/pip-install-98c9o0q4
1 location(s) to search for versions of ctc-segmentation:
* https://pypi.org/simple/ctc-segmentation/
Getting page https://pypi.org/simple/ctc-segmentation/
Found index url https://pypi.org/simple
Looking up "https://pypi.org/simple/ctc-segmentation/" in the cache
Request header has "max_age" as 0, cache bypassed
Starting new HTTPS connection (1): pypi.org:443
https://pypi.org:443 "GET /simple/ctc-segmentation/ HTTP/1.1" 304 0
Analyzing links from page https://pypi.org/simple/ctc-segmentation/
  Found link https://files.pythonhosted.org/packages/5c/49/70f81b78a2c67bcfe2e72a8c3be91430f0f822857f5b8f5587cc8a1d0de0/ctc_segmentation-1.0.1.tar.gz#sha256=f146adf31fc225a3594cd52dd57b6da754808b00ca1865aeab0ad978b38909fb (from https://pypi.org/simple/ctc-segmentation/) (requires-python:>=3), version: 1.0.1
  Found link https://files.pythonhosted.org/packages/67/be/5fdbb4e536cfa07affe57f947074a5f5b5325a22aebf4c661e21ca10187c/ctc_segmentation-1.0.2.tar.gz#sha256=84584a4251988414262941293f31d295fd9c406ce1295ea50306fca8a28bdf30 (from https://pypi.org/simple/ctc-segmentation/) (requires-python:>=3), version: 1.0.2
  Found link https://files.pythonhosted.org/packages/ae/0e/695a66ba2e15f741a8fb27496a7bd5a7b90e292ef54e76adf09b41f4ba93/ctc_segmentation-1.0.3.tar.gz#sha256=e51b2e688d563fcd0a6cac83f84147f587ac098e98db72cb8c6e7371f2723bc2 (from https://pypi.org/simple/ctc-segmentation/) (requires-python:>=3), version: 1.0.3
  Found link https://files.pythonhosted.org/packages/53/1d/1ce0dca81061c7b22bc4c83977800fcf5091f3355170ee7dfbd80c3ed9ad/ctc_segmentation-1.0.4.tar.gz#sha256=fb856f16186086f21a1322b49c138fb96f27761a2d7e7124351f23df3e3e0ebb (from https://pypi.org/simple/ctc-segmentation/) (requires-python:>=3), version: 1.0.4
Given no hashes to check 4 links for project 'ctc-segmentation': discarding no candidates
Using version 1.0.4 (newest of versions: 1.0.1, 1.0.2, 1.0.3, 1.0.4)
Collecting ctc-segmentation
  Created temporary directory: /tmp/pip-unpack-q2zt2e8q
  Looking up "https://files.pythonhosted.org/packages/53/1d/1ce0dca81061c7b22bc4c83977800fcf5091f3355170ee7dfbd80c3ed9ad/ctc_segmentation-1.0.4.tar.gz" in the cache
  Current age based on date: 48
  Ignoring unknown cache-control directive: immutable
  Freshness lifetime from max-age: 365000000
  The response is "fresh", returning cached response
  365000000 > 48
  Using cached https://files.pythonhosted.org/packages/53/1d/1ce0dca81061c7b22bc4c83977800fcf5091f3355170ee7dfbd80c3ed9ad/ctc_segmentation-1.0.4.tar.gz
  Added ctc-segmentation from https://files.pythonhosted.org/packages/53/1d/1ce0dca81061c7b22bc4c83977800fcf5091f3355170ee7dfbd80c3ed9ad/ctc_segmentation-1.0.4.tar.gz#sha256=fb856f16186086f21a1322b49c138fb96f27761a2d7e7124351f23df3e3e0ebb to build tracker '/tmp/pip-req-tracker-dwauuihb'
    Running setup.py (path:/tmp/pip-install-98c9o0q4/ctc-segmentation/setup.py) egg_info for package ctc-segmentation
    Running command python setup.py egg_info

    Error compiling Cython file:
    ------------------------------------------------------------
    ...
    #!/usr/bin/env false
    ^
    ------------------------------------------------------------

    ctc_segmentation/ctc_segmentation_dyn.pyx:1:0: 'ctc_segmentation/ctc_segmentation_dyn' is not a valid module name
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-98c9o0q4/ctc-segmentation/setup.py", line 17, in <module>
        extensions = cythonize(extensions, include_path=[numpy.get_include()])
      File "/usr/local/lib/python3.6/dist-packages/Cython/Build/Dependencies.py", line 1102, in cythonize
        cythonize_one(*args)
      File "/usr/local/lib/python3.6/dist-packages/Cython/Build/Dependencies.py", line 1225, in cythonize_one
        raise CompileError(None, pyx_file)
    Cython.Compiler.Errors.CompileError: ctc_segmentation/ctc_segmentation_dyn.pyx
    Compiling ctc_segmentation/ctc_segmentation_dyn.pyx because it depends on /usr/local/lib/python3.6/dist-packages/Cython/Includes/numpy/__init__.pxd.
    [1/1] Cythonizing ctc_segmentation/ctc_segmentation_dyn.pyx
Cleaning up...
  Removing source in /tmp/pip-install-98c9o0q4/ctc-segmentation
Removed ctc-segmentation from https://files.pythonhosted.org/packages/53/1d/1ce0dca81061c7b22bc4c83977800fcf5091f3355170ee7dfbd80c3ed9ad/ctc_segmentation-1.0.4.tar.gz#sha256=fb856f16186086f21a1322b49c138fb96f27761a2d7e7124351f23df3e3e0ebb from build tracker '/tmp/pip-req-tracker-dwauuihb'
Removed build tracker '/tmp/pip-req-tracker-dwauuihb'
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Exception information:
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/pip/_internal/cli/base_command.py", line 153, in _main
    status = self.run(options, args)
  File "/usr/local/lib/python3.6/dist-packages/pip/_internal/commands/install.py", line 382, in run
    resolver.resolve(requirement_set)
  File "/usr/local/lib/python3.6/dist-packages/pip/_internal/legacy_resolve.py", line 201, in resolve
    self._resolve_one(requirement_set, req)
  File "/usr/local/lib/python3.6/dist-packages/pip/_internal/legacy_resolve.py", line 365, in _resolve_one
    abstract_dist = self._get_abstract_dist_for(req_to_install)
  File "/usr/local/lib/python3.6/dist-packages/pip/_internal/legacy_resolve.py", line 313, in _get_abstract_dist_for
    req, self.session, self.finder, self.require_hashes
  File "/usr/local/lib/python3.6/dist-packages/pip/_internal/operations/prepare.py", line 224, in prepare_linked_requirement
    req, self.req_tracker, finder, self.build_isolation,
  File "/usr/local/lib/python3.6/dist-packages/pip/_internal/operations/prepare.py", line 49, in _get_prepared_distribution
    abstract_dist.prepare_distribution_metadata(finder, build_isolation)
  File "/usr/local/lib/python3.6/dist-packages/pip/_internal/distributions/source/legacy.py", line 39, in prepare_distribution_metadata
    self.req.prepare_metadata()
  File "/usr/local/lib/python3.6/dist-packages/pip/_internal/req/req_install.py", line 563, in prepare_metadata
    self.metadata_directory = metadata_generator(self)
  File "/usr/local/lib/python3.6/dist-packages/pip/_internal/operations/generate_metadata.py", line 124, in _generate_metadata_legacy
    command_desc='python setup.py egg_info',
  File "/usr/local/lib/python3.6/dist-packages/pip/_internal/utils/subprocess.py", line 242, in call_subprocess
    raise InstallationError(exc_msg)
pip._internal.exceptions.InstallationError: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
```


Discussion:
If you install it directly from github like `pip install git+https://github.com/lumaku/ctc-segmentation` then everything is ok.
@lumaku Could you merge @kamo-naoyuki 's patch?

Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -18,7 +18,8 @@
         "editdistance==0.5.2",
         "gdown",
         "espnet_model_zoo",
-        "ctc-segmentation",
+        # FIXME(kan-bayashi): Add after update
+        # "ctc-segmentation",
         # DNN related packages are installed by Makefile
         # 'torch==1.0.1'
         # "chainer==6.0.0",


Test patch: