Bug 247595 - games/py-mnemosyne: Fails to run: ModuleNotFoundError: No module named 'googletrans'
Summary: games/py-mnemosyne: Fails to run: ModuleNotFoundError: No module named 'googl...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Loïc Bartoletti
URL:
Keywords: needs-patch, needs-qa
Depends on:
Blocks:
 
Reported: 2020-06-27 16:00 UTC by Gian-Simon Purkert
Modified: 2020-08-01 07:49 UTC (History)
4 users (show)

See Also:
koobs: merge-quarterly?


Attachments
py-mnemosyne-add-missing-dependencies.patch (11.34 KB, patch)
2020-07-13 08:38 UTC, Kai Knoblich
kai: maintainer-approval+
Details | Diff
py-mnemosyne-add-missing-dependencies.patch (11.86 KB, patch)
2020-07-16 20:45 UTC, Loïc Bartoletti
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Gian-Simon Purkert 2020-06-27 16:00:49 UTC
Stops with that error:

Traceback (innermost last):
  File "/usr/local/bin/mnemosyne", line 270, in <module>
    debug_file=options.debug_file)
  File "/usr/local/lib/python3.7/site-packages/mnemosyne/libmnemosyne/__init__.py", line 400, in initialise
    self.register_components()
  File "/usr/local/lib/python3.7/site-packages/mnemosyne/libmnemosyne/__init__.py", line 465, in register_components
    importlib.import_module(module_name), class_name)
  File "/usr/local/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/usr/local/lib/python3.7/site-packages/mnemosyne/libmnemosyne/translators/google_translator.py", line 5, in <module>
    from googletrans import Translator as gTranslator
 ModuleNotFoundError: No module named 'googletrans'
Comment 1 Li-Wen Hsu freebsd_committer freebsd_triage 2020-07-04 14:16:42 UTC
There is no maintainer of this port currently, would you want to create a patch fix this and take the maintainership? Thanks!
Comment 2 Kubilay Kocak freebsd_committer freebsd_triage 2020-07-05 03:26:00 UTC
Needs two ports:

- googletrans
- gtts (apparently)
Comment 3 Kai Knoblich freebsd_committer freebsd_triage 2020-07-13 08:38:10 UTC
Created attachment 216413 [details]
py-mnemosyne-add-missing-dependencies.patch

Here's a first draft of patch that adds the missing dependencies:

- audio/py-gtts
- security/py-gtts-token (required by audio/py-gtts)
- textproc/py-googletrans

The games/py-mnemosyne port needs to be limited to Python 3.7+ to keep the dependency chains intact. This is because textproc/py-googletrans depends on www/py-httpx which is only for Python 3.7+ .

We definitely need also to merge whole changes to the 2020Q3 branch as the port is broken there at the moment.

(In reply to gspu from comment #0)

I already did some small runtime tests and the games/py-mnemosyne starts as expected.  Can you please test the attached patch if it works for you?
Comment 4 Gian-Simon Purkert 2020-07-15 10:36:37 UTC
Works for me, nice! 

Thanks allot.
Comment 5 Loïc Bartoletti freebsd_committer freebsd_triage 2020-07-16 20:45:35 UTC
Created attachment 216499 [details]
py-mnemosyne-add-missing-dependencies.patch

Changes from kai's patch:

games/py-mnemosyne:
- Take Maintainer'ship
- Alphabetize USE_PYTHON and add concurrent since it installs bin/mnemosyne
- Fix post-patch

textproc/py-googletrans:
- Use == as equality for httpx version


Thanks kai
Comment 6 commit-hook freebsd_committer freebsd_triage 2020-07-30 19:19:11 UTC
A commit references this bug:

Author: lbartoletti
Date: Thu Jul 30 19:18:15 UTC 2020
New revision: 543817
URL: https://svnweb.freebsd.org/changeset/ports/543817

Log:
  games/py-mnemosyne: Take Maintainer'ship, fix runtime error and add missing dependencies

  Latest version of games/py-mnemosyne requires new dependencies. This commit adds the missing dependencies:

   - audio/py-gtts
   - security/py-gtts-token (required by audio/py-gtts)
   - textproc/py-googletrans

  The games/py-mnemosyne port needs to be limited to Python 3.7+ to keep the dependency chains intact. This is because textproc/py-googletrans depends on www/py-httpx which is only for Python 3.7+.

  PR:		247595
  Submitted by:	kai
  Reported by:	gspurki@gmail.com
  Approved by:	tcberner (mentor)
  MFH:		2020Q3
  Differential Revision:	https://reviews.freebsd.org/D25895

Changes:
  head/audio/Makefile
  head/audio/py-gtts/
  head/audio/py-gtts/Makefile
  head/audio/py-gtts/distinfo
  head/audio/py-gtts/pkg-descr
  head/games/py-mnemosyne/Makefile
  head/security/Makefile
  head/security/py-gtts-token/
  head/security/py-gtts-token/Makefile
  head/security/py-gtts-token/distinfo
  head/security/py-gtts-token/pkg-descr
  head/textproc/Makefile
  head/textproc/py-googletrans/
  head/textproc/py-googletrans/Makefile
  head/textproc/py-googletrans/distinfo
  head/textproc/py-googletrans/pkg-descr
Comment 7 commit-hook freebsd_committer freebsd_triage 2020-08-01 07:16:33 UTC
A commit references this bug:

Author: lbartoletti
Date: Sat Aug  1 07:15:40 UTC 2020
New revision: 543891
URL: https://svnweb.freebsd.org/changeset/ports/543891

Log:
  MFH: r543817

  games/py-mnemosyne: Take Maintainer'ship, fix runtime error and add missing dependencies

  Latest version of games/py-mnemosyne requires new dependencies. This commit adds the missing dependencies:

   - audio/py-gtts
   - security/py-gtts-token (required by audio/py-gtts)
   - textproc/py-googletrans

  The games/py-mnemosyne port needs to be limited to Python 3.7+ to keep the dependency chains intact. This is because textproc/py-googletrans depends on www/py-httpx which is only for Python 3.7+.

  PR:		247595
  Submitted by:	kai
  Reported by:	gspurki@gmail.com
  Approved by:	tcberner (mentor)
  Differential Revision:	https://reviews.freebsd.org/D25895

  Approved by:	ports-secteam (joneum)

Changes:
_U  branches/2020Q3/
  branches/2020Q3/audio/Makefile
  branches/2020Q3/audio/py-gtts/
  branches/2020Q3/games/py-mnemosyne/Makefile
  branches/2020Q3/security/Makefile
  branches/2020Q3/security/py-gtts-token/
  branches/2020Q3/textproc/Makefile
  branches/2020Q3/textproc/py-googletrans/
Comment 8 Loïc Bartoletti freebsd_committer freebsd_triage 2020-08-01 07:49:56 UTC
Committed and merged in quarterly too. Thanks.