Spacy: AssertionError when downloading models on pip 19.0, Ubuntu 18.10

Created on 22 Jan 2019  路  6Comments  路  Source: explosion/spaCy

How to reproduce the problem

When running python -m spacy download en_core_web_sm, I am getting an AssertionError within pip internals. Since I've been using spacy forever and I'd never seen this before, I downgraded pip to 18.1 (from 19.0) and the error disappeared. I am on Pop!_OS, which is a thin layer over Ubuntu 18.10.

(venv) sam@pop-os:~/$ pip --version
pip 19.0 from /home/sam/venv/lib/python3.6/site-packages/pip (python 3.6)
(venv) sam@pop-os:~/$ python -m spacy download en_core_web_sm
Collecting en_core_web_sm==2.0.0 from https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-2.0.0/en_core_web_sm-2.0.0.tar.gz#egg=en_core_web_sm==2.0.0
  Downloading https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-2.0.0/en_core_web_sm-2.0.0.tar.gz (37.4MB)
    100% |鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅| 37.4MB 78.8MB/s 
Exception:
Traceback (most recent call last):
  File "/home/sam/venv/lib/python3.6/site-packages/pip/_internal/cli/base_command.py", line 176, in main
    status = self.run(options, args)
  File "/home/sam/venv/lib/python3.6/site-packages/pip/_internal/commands/install.py", line 346, in run
    session=session, autobuilding=True
  File "/home/sam/venv/lib/python3.6/site-packages/pip/_internal/wheel.py", line 848, in build
    assert building_is_possible
AssertionError
(venv) sam@pop-os:~/$ pip install pip==18.1
(venv) sam@pop-os:~/$ python -m spacy download en_core_web_sm
Collecting en_core_web_sm==2.0.0 from https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-2.0.0/en_core_web_sm-2.0.0.tar.gz#egg=en_core_web_sm==2.0.0
  Downloading https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-2.0.0/en_core_web_sm-2.0.0.tar.gz (37.4MB)
    100% |鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅| 37.4MB 63.5MB/s 
Installing collected packages: en-core-web-sm
  Running setup.py install for en-core-web-sm ... done
Successfully installed en-core-web-sm-2.0.0

Your Environment

Info about spaCy

  • spaCy version: 2.0.18
  • Platform: Linux-4.18.0-13-generic-x86_64-with-Ubuntu-18.10-cosmic
  • Python version: 3.6.7
  • Models: en_core_web_sm
install pip third-party

Most helpful comment

Yes, the model downloader sets --no-cache-dir by default, to prevent the (potentially very large) model packages from being cached. So from that thread, it sounds like this is a more general pip issue and we just have to wait for a new pip update that resolves this?

Apparently another workaround is setting --cache-dir=/pipcache (any arbitrary directory manually) and then removing that cache? spacy download will pass all additional arguments down to the pip install call, so you could try python -m spacy download en_core_web_sm --cache-dir=/pipcache.

All 6 comments

Yes, the model downloader sets --no-cache-dir by default, to prevent the (potentially very large) model packages from being cached. So from that thread, it sounds like this is a more general pip issue and we just have to wait for a new pip update that resolves this?

Apparently another workaround is setting --cache-dir=/pipcache (any arbitrary directory manually) and then removing that cache? spacy download will pass all additional arguments down to the pip install call, so you could try python -m spacy download en_core_web_sm --cache-dir=/pipcache.

a possible workaround is downgrading by issuing pip install pip==18 or if you specifically need python3, like usually on Mac: pip3 install pip==18

New pip version seems to have resolved this

New pip version seems to have resolved this

For others reading this: this refers to version 19.0.1

Issue can be closed.

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.

Was this page helpful?
0 / 5 - 0 ratings