From 692eb0603d5305a19407302721d4cd6790235496 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Mon, 20 Mar 2017 18:24:44 +0100 Subject: [PATCH] Fix high memory usage in download command Due to PyPi issue #2984, installing large packages via pip causes a large spike in memory usage. The recommended fix is to disable caching. --- spacy/cli/download.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spacy/cli/download.py b/spacy/cli/download.py index 446de4a37..56dbd5264 100644 --- a/spacy/cli/download.py +++ b/spacy/cli/download.py @@ -56,7 +56,8 @@ def get_version(model, comp): def download_model(filename): util.print_msg("Downloading {f}".format(f=filename)) download_url = about.__download_url__ + '/' + filename - subprocess.call([sys.executable, '-m', 'pip', 'install', download_url], + subprocess.call([sys.executable, '-m', + 'pip', 'install', '--no-cache-dir', download_url], env=os.environ.copy())