Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Got "ModuleNotFoundError: No module named 'regex'" when started ebook2audiobook.sh #222

Open
dragon1020 opened this issue Jan 13, 2025 · 4 comments

Comments

@dragon1020
Copy link

Debian 12.6
Python 3.11.2

Module regex is installed system-wide (0.1.20221031-1+b1), and there is no errors when I start python and enters "import regex". But ebook2audiobook.sh ended with error:

Collecting mecab (from -r requirements.txt (line 15))
  Using cached mecab-0.996.5.tar.gz (64 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [14 lines of output]
      /bin/sh: 1: mecab-config: not found
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-u7mhcx83/mecab_3c240c4a4f14436ea366ffb536a9b94d/setup.py", line 49, in <module>
          include_dirs=cmd2("mecab-config --inc-dir"),
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-install-u7mhcx83/mecab_3c240c4a4f14436ea366ffb536a9b94d/setup.py", line 19, in cmd2
          return cmd1(strings).split()
                 ^^^^^^^^^^^^^
        File "/tmp/pip-install-u7mhcx83/mecab_3c240c4a4f14436ea366ffb536a9b94d/setup.py", line 15, in cmd1
          return os.popen(strings).readlines()[0].rstrip()
                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^
      IndexError: list index out of range
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
Traceback (most recent call last):
  File "/home/dragon/ebook2audiobook/app.py", line 3, in <module>
    import regex as re
ModuleNotFoundError: No module named 'regex'

@ROBERT-MCDOWELL
Copy link
Collaborator

ROBERT-MCDOWELL commented Jan 13, 2025

this is fixed in next version (2.1.0)
thanks

@Mieraidihaimu
Copy link

Thanks, hopefully after this fix, I can run it on my Base model M4 mini

@ROBERT-MCDOWELL
Copy link
Collaborator

meanwhile you can add it manually:
conda activate ./python_env
pip install regex
conda deactivate

@matbgn
Copy link

matbgn commented Jan 19, 2025

ℹ For my Ubuntu (almost fresh) installation following lines were needed in the script:

@@ -41 +41 @@
-REQUIRED_PROGRAMS=("calibre" "ffmpeg")
+REQUIRED_PROGRAMS=("calibre" "ffmpeg" "mecab" "libmecab-dev")

And

@@ -315,2 +315,3 @@
 conda activate $SCRIPT_DIR/$PYTHON_ENV
+python -m pip install regex unidic
 python app.py --script_mode $SCRIPT_MODE $ARGS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants