FS#68317 - [python-nltk] Dependency on python-regex should be stated more clearly

Attached to Project: Community Packages
Opened by Arsenii (ettavolt) - Sunday, 18 October 2020, 07:45 GMT
Last edited by Morten Linderud (Foxboron) - Friday, 09 July 2021, 12:04 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Morten Linderud (Foxboron)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Description:
Without the python-regex module import of the entire package can't complete:

ModuleNotFoundError Traceback (most recent call last)
<ipython-input-1-9390af682de4> in <module>
7
8 import torch
----> 9 import nltk
10 import gensim
11 import gensim.downloader as api

/usr/lib/python3.8/site-packages/nltk/__init__.py in <module>
131 from nltk.grammar import *
132 from nltk.probability import *
--> 133 from nltk.text import *
134 from nltk.tree import *
135 from nltk.util import *

/usr/lib/python3.8/site-packages/nltk/text.py in <module>
28 from nltk.metrics import f_measure, BigramAssocMeasures
29 from nltk.collocations import BigramCollocationFinder
---> 30 from nltk.tokenize import sent_tokenize
31
32 ConcordanceLine = namedtuple(

/usr/lib/python3.8/site-packages/nltk/tokenize/__init__.py in <module>
64
65 from nltk.data import load
---> 66 from nltk.tokenize.casual import TweetTokenizer, casual_tokenize
67 from nltk.tokenize.mwe import MWETokenizer
68 from nltk.tokenize.destructive import NLTKWordTokenizer

/usr/lib/python3.8/site-packages/nltk/tokenize/casual.py in <module>
36 ######################################################################
37
---> 38 import regex # https://github.com/nltk/nltk/issues/2409
39 import html
40

ModuleNotFoundError: No module named 'regex'

Additional info:
* python-nltk 3.5-2
* nltk's pip-req has it: https://github.com/nltk/nltk/blob/develop/pip-req.txt
This task depends upon

Closed by  Morten Linderud (Foxboron)
Friday, 09 July 2021, 12:04 GMT
Reason for closing:  Fixed
Additional comments about closing:  3.6.2-4
Comment by Diego (dieggsy) - Sunday, 06 December 2020, 19:06 GMT
I agree with this - the package is installable but not exactly usable without python-regex. Maybe it should be a required dep. There is a similar problem with this package requiring python-docopt for certain things (though I can't recall exactly for what atm) so perhaps that should be added as an optional/required dep as well.
Comment by Benjamin van der Burgh (Gringo) - Wednesday, 05 May 2021, 05:22 GMT
This issue is still present after more than 1.5 years. I think python-regex should be a dependency, or at least an optional dependency.

Loading...