Closed alvarobartt closed 3 years ago
@alvarobartt please
pip install textattack[tensorflow,optional]
Sure @qiyanjun, but shouldn't an ImportError
be raised detailing how to install the missing dependencies? Also, I assume that the --help
flag shouldn't require any dependency, so the try: ... except ImportError: ...
block should be implemented as far as I'm concerned ππ» Anyway great job with the package!
I see. Great suggestion. Will add
Sent from my iPhone
On Sep 29, 2021, at 17:10, Γlvaro BartolomΓ© @.***> wrote:
ο»Ώ Sure @qiyanjun, but shouldn't an ImportError be raised detailing how to install the missing dependencies? Also, I assume that the --help flag shouldn't require any dependency, so the try: ... except ImportError: ... block should be implemented as far as I'm concerned ππ» Anyway great job with the package!
β You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.
I may create a fork and then a PR so as to address this, so I'll let you know! :+1:
Thanks
Sent from my iPhone
On Sep 30, 2021, at 03:32, Γlvaro BartolomΓ© @.***> wrote:
ο»Ώ I may create a fork and then a PR so as to address this, so I'll let you know! π
β You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.
see PR #535
Thanks @qiyanjun, that can do the work in the meantime to avoid issues with the installation π
Describe the bug
For the first time you install
textattack
withpip install textattack
and you try totextattack attack --help
it will start installing some NLTK dependencies, but at some point it will fail with the error codeModuleNotFoundError: No module named 'tensorflow_text'
.So that even though
tensorflow_text
is an optional requirement, it's mandatory so as to runtextattack attack --help
.To Reproduce
Steps to reproduce the behavior:
pip install textattack
on an empty environmenttextattack attack --help
Expected behavior
An ImportError shouldn't pop out while checking for the
--help
of a CLI command, and since this is the case,tensorflow_text
could be included as a mandatory/default requirement, or just handle the ImportError so that the user knows what optional requirements need to be installed.Screenshots or Traceback
System Information (please complete the following information):
textattack
version: 0.3.3