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

spacy.cli.download is no longer available #13039

Closed
omri374 opened this issue Oct 4, 2023 · 5 comments · Fixed by #13040
Closed

spacy.cli.download is no longer available #13039

omri374 opened this issue Oct 4, 2023 · 5 comments · Fixed by #13040
Labels
bug Bugs and behaviour differing from documentation feat / cli Feature: Command-line interface

Comments

@omri374
Copy link
Contributor

omri374 commented Oct 4, 2023

In the last release (3.7.0), the ability to call spacy.cli.download(MODEL) is no longer available.
Is there another way to download models through a Python script, or can the spacy.cli package be reintroduced?

In our use case, we propose the use of downloaded spacy models by default. If the user inputted a spacy model name which isn't installed, we wish to install it lazily, therefore the CLI command isn't a good fit for us.

Potentially an outcome of #12962

How to reproduce the behaviour

import spacy

spacy.cli.download("en_core_web_lg")

# AttributeError: module 'spacy' has no attribute 'cli'

Your Environment

  • spaCy version: 3.7.0
  • Platform: macOS-14.0-arm64-arm-64bit
  • Python version: 3.9.16
  • Pipelines: el_core_news_lg (3.5.0), en_core_web_lg (3.6.0), sv_core_news_sm (3.6.0), en_core_web_sm (3.6.0), en_core_web_trf (3.5.0), es_core_news_sm (3.5.0), es_core_news_md (3.5.0), en_core_web_md (3.5.0)
@adrianeboyd adrianeboyd added bug Bugs and behaviour differing from documentation feat / cli Feature: Command-line interface labels Oct 4, 2023
@adrianeboyd
Copy link
Contributor

That does look like an unintended side effect of #12962. My initial guess is that the best course of action will be to revert it.

@adrianeboyd adrianeboyd linked a pull request Oct 4, 2023 that will close this issue
3 tasks
@omri374
Copy link
Contributor Author

omri374 commented Oct 4, 2023

Update: calling from spacy.cli import download works. It's just the specific availability of spacy.cli which had changed.

@adrianeboyd
Copy link
Contributor

Yeah, we have do have plenty of tests including imports like from spacy.cli import download, but not for just spacy.cli or spacy.cli.download.

@adrianeboyd
Copy link
Contributor

And I don't understand why this breaks the availability of the whole spacy.cli module. But it's pretty breaking, so we'll release v3.7.1 with this reverted.

Copy link
Contributor

github-actions bot commented Nov 4, 2023

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Bugs and behaviour differing from documentation feat / cli Feature: Command-line interface
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants