fgnt / nara_wpe

Different implementations of "Weighted Prediction Error" for speech dereverberation
MIT License
474 stars 165 forks source link

How to run examples #36

Closed Sciss closed 4 years ago

Sciss commented 4 years ago

Hello. Noobie question, as someone not really familiar with pip - if I follow the README and run pip install --editable ., this happens, but how do I run example code?

Obtaining file:///home/hhrutz/Documents/devel/nara_wpe
Requirement already satisfied: pathlib2; python_version < "3.0" in /usr/lib/python2.7/dist-packages (from nara-wpe==0.0.6) (2.3.3)
Requirement already satisfied: numpy in /home/hhrutz/.local/lib/python2.7/site-packages (from nara-wpe==0.0.6) (1.12.1)
Collecting tqdm (from nara-wpe==0.0.6)
  Downloading https://files.pythonhosted.org/packages/bb/62/6f823501b3bf2bac242bd3c320b592ad1516b3081d82c77c1d813f076856/tqdm-4.39.0-py2.py3-none-any.whl (53kB)
    100% |████████████████████████████████| 61kB 675kB/s 
Collecting soundfile (from nara-wpe==0.0.6)
  Downloading https://files.pythonhosted.org/packages/68/64/1191352221e2ec90db7492b4bf0c04fd9d2508de67b3f39cbf093cd6bd86/SoundFile-0.10.2-py2.py3-none-any.whl
Collecting bottleneck (from nara-wpe==0.0.6)
  Downloading https://files.pythonhosted.org/packages/62/d0/55bbb49f4fade3497de2399af70ec0a06e432c786b8623c878b11e90d456/Bottleneck-1.3.1.tar.gz (88kB)
    100% |████████████████████████████████| 92kB 1.7MB/s 
  Installing build dependencies ... done
Requirement already satisfied: click in /usr/lib/python2.7/dist-packages (from nara-wpe==0.0.6) (7.0)
Requirement already satisfied: scandir in /usr/lib/python2.7/dist-packages (from pathlib2; python_version < "3.0"->nara-wpe==0.0.6) (1.9.0)
Collecting cffi>=1.0 (from soundfile->nara-wpe==0.0.6)
  Downloading https://files.pythonhosted.org/packages/93/5d/c4f950891251e478929036ca07b22f0b10324460c1d0a4434c584481db51/cffi-1.13.2-cp27-cp27mu-manylinux1_x86_64.whl (384kB)
    100% |████████████████████████████████| 389kB 1.5MB/s 
Collecting pycparser (from cffi>=1.0->soundfile->nara-wpe==0.0.6)
  Downloading https://files.pythonhosted.org/packages/68/9e/49196946aee219aead1290e00d1e7fdeab8567783e83e1b9ab5585e6206a/pycparser-2.19.tar.gz (158kB)
    100% |████████████████████████████████| 163kB 912kB/s 
Building wheels for collected packages: bottleneck, pycparser
  Running setup.py bdist_wheel for bottleneck ... done
  Stored in directory: /home/hhrutz/.cache/pip/wheels/31/36/8f/1ed7e6f1b3295499c8bbab934262f2494d0f6aebe0c5860754
  Running setup.py bdist_wheel for pycparser ... done
  Stored in directory: /home/hhrutz/.cache/pip/wheels/f2/9a/90/de94f8556265ddc9d9c8b271b0f63e57b26fb1d67a45564511
Successfully built bottleneck pycparser
Installing collected packages: tqdm, pycparser, cffi, soundfile, bottleneck, nara-wpe
  The script tqdm is installed in '/home/hhrutz/.local/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
  Running setup.py develop for nara-wpe
Successfully installed bottleneck-1.3.1 cffi-1.13.2 nara-wpe pycparser-2.19 soundfile-0.10.2 tqdm-4.39.0

I'm kind of lost here as to the next step. I installed juypiter via pip install jupyter --user, then run jupyter-notebook and in the browser try to open an example. But something is not right:

$ jupyter-notebook 
[I 23:10:37.685 NotebookApp] Serving notebooks from local directory: /home/hhrutz/Documents/devel/nara_wpe
[I 23:10:37.685 NotebookApp] The Jupyter Notebook is running at:
[I 23:10:37.685 NotebookApp] http://localhost:8888/?token=c7eb70e17b0f6c7495ec505fd788f22dfcd5879c1dd157aa
[I 23:10:37.685 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 23:10:37.688 NotebookApp] 

    To access the notebook, open this file in a browser:
        file:///home/hhrutz/.local/share/jupyter/runtime/nbserver-3688-open.html
    Or copy and paste one of these URLs:
        http://localhost:8888/?token=c7eb70e17b0f6c7495ec505fd788f22dfcd5879c1dd157aa
[E 23:10:43.634 NotebookApp] Uncaught exception GET /notebooks/examples/WPE_Numpy_offline.ipynb (::1)
    HTTPServerRequest(protocol='http', host='localhost:8888', method='GET', uri='/notebooks/examples/WPE_Numpy_offline.ipynb', version='HTTP/1.1', remote_ip='::1')
    Traceback (most recent call last):
      File "/home/hhrutz/.local/lib/python2.7/site-packages/tornado/web.py", line 1590, in _execute
        result = method(*self.path_args, **self.path_kwargs)
      File "/home/hhrutz/.local/lib/python2.7/site-packages/tornado/web.py", line 3006, in wrapper
        return method(self, *args, **kwargs)
      File "/home/hhrutz/.local/lib/python2.7/site-packages/notebook/notebook/handlers.py", line 59, in get
        get_custom_frontend_exporters=get_custom_frontend_exporters
      File "/home/hhrutz/.local/lib/python2.7/site-packages/notebook/base/handlers.py", line 519, in render_template
        return template.render(**ns)
      File "/home/hhrutz/.local/lib/python2.7/site-packages/jinja2/environment.py", line 1008, in render
        return self.environment.handle_exception(exc_info, True)
      File "/home/hhrutz/.local/lib/python2.7/site-packages/jinja2/environment.py", line 780, in handle_exception
        reraise(exc_type, exc_value, tb)
      File "/home/hhrutz/.local/lib/python2.7/site-packages/notebook/templates/notebook.html", line 1, in top-level template code
        {% extends "page.html" %}
      File "/home/hhrutz/.local/lib/python2.7/site-packages/notebook/templates/page.html", line 154, in top-level template code
        {% block header %}
      File "/home/hhrutz/.local/lib/python2.7/site-packages/notebook/templates/notebook.html", line 120, in block "header"
        {% for exporter in get_custom_frontend_exporters() %}
      File "/home/hhrutz/.local/lib/python2.7/site-packages/notebook/notebook/handlers.py", line 19, in get_custom_frontend_exporters
        from nbconvert.exporters.base import get_export_names, get_exporter
      File "/home/hhrutz/.local/lib/python2.7/site-packages/nbconvert/__init__.py", line 4, in <module>
        from .exporters import *
      File "/home/hhrutz/.local/lib/python2.7/site-packages/nbconvert/exporters/__init__.py", line 1, in <module>
        from .base import (export, get_exporter,
      File "/home/hhrutz/.local/lib/python2.7/site-packages/nbconvert/exporters/base.py", line 8, in <module>
        import entrypoints
      File "/usr/lib/python2.7/dist-packages/entrypoints.py", line 16, in <module>
        import configparser
      File "/home/hhrutz/.local/lib/python2.7/site-packages/configparser.py", line 11, in <module>
        from backports.configparser import (
    ImportError: cannot import name ConverterMapping
Sciss commented 4 years ago

Seems a conflict between python (debian) and python (pip). After doing sudo apt remove python-configparser and reinstalling juypter via pip, this goes away. However, now I seem to have to install more packages by hand.

LukasDrude commented 4 years ago

Dear Hanns,

I recommend that you use a dedicated Python environment for your research. We typically use Anaconda since this comes with, e.g., Numpy built-in.