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

Model installer doesn't check for permissions until /after/ downloading the relevant model. #2082

Closed
fake-name opened this issue Mar 10, 2018 · 5 comments
Labels
enhancement Feature requests and improvements feat / cli Feature: Command-line interface install Installation issues

Comments

@fake-name
Copy link

fake-name commented Mar 10, 2018

This is a minor issue.

Basically, if you run python3 -m spacy download en_core_web_lg (or similar), the requisite install permissions are not checked until after the selected model has downloaded. The install then aboirts with a permission issue, and apparently any temporary downloads are deleted.

This means you can potentially wait a long time for a model to download, only to discover that you actually needed to run the command with sudo.

Furthermore, the downloaded model appears to not be cached, as rerunning python3 -m spacy download en_core_web_lg with sudo does not seem to be aware that the model was already downloaded.

It seems that it'd be ideal to have python3 -m spacy download either check for the permissions it needs to install the file it will download before beginning it's download, or have it store the temp downloads somewhere, and check there before doing a web retrieval.

@ines ines added enhancement Feature requests and improvements install Installation issues labels Mar 27, 2018
@ines
Copy link
Member

ines commented Mar 27, 2018

Thanks a lot – I definitely agree. We're aware of this problem and still thinking about the best cross-platform solution for this. I'll merge this issue with #1456, which is a collection of related issues and enhancement proposals around spacy download. We're also always open for suggestions if you have an idea for a good solution to this.

@ines ines closed this as completed Mar 27, 2018
@fake-name
Copy link
Author

Yeah, cross platform is really annoying.

This particular issue should be solvable in a platform-agnostic manner by just opening the output file before starting the download, I think?

@ines
Copy link
Member

ines commented Mar 27, 2018

Thanks, that's a good point! The only problem here is that spacy download actually delegates to pip install in a subprocess, which will then download the file (and store it somewhere in the pip cache) and then install it. I haven't looked into this in a while, but so far, I couldn't find a way to make pip test the permissions first. There might be a way to work around this with a temporary directory and pip download – but this seems like an overcomplicated roundtrip...

@ines ines added the feat / cli Feature: Command-line interface label Mar 27, 2018
@fake-name
Copy link
Author

Ah, well, that's a good reason.

@lock
Copy link

lock bot commented May 7, 2018

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.

@lock lock bot locked as resolved and limited conversation to collaborators May 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Feature requests and improvements feat / cli Feature: Command-line interface install Installation issues
Projects
None yet
Development

No branches or pull requests

2 participants