spaCy: ValueError: spacy.syntax.nn_parser.Parser size changed, may indicate binary incompatibility. Expected 72 from C header, got 64 from PyObject

I’ve seen this issue pop up a few other times, but most people report solving with a quick uninstall and reinstall. I’ve tried that several times to no avail.

My code:

import spacy
!python -m spacy download en
from spacy.lang.en import English
parser = English()
import en_core_web_sm
nlp = spacy.load('en_core_web_sm')

Full traceback:

Requirement already satisfied: 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 in /Users/lmcquillan/anaconda3/lib/python3.7/site-packages (2.0.0)

    Linking successful
    /Users/lmcquillan/anaconda3/lib/python3.7/site-packages/en_core_web_sm
    -->
    /Users/lmcquillan/anaconda3/lib/python3.7/site-packages/spacy/data/en

    You can now load the model via spacy.load('en')

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-8-9016a6b1ed29> in <module>
      2 
      3 
----> 4 from spacy.lang.en import English
      5 parser = English()
      6 import en_core_web_sm

~/anaconda3/lib/python3.7/site-packages/spacy/lang/en/__init__.py in <module>
     13 from ..tokenizer_exceptions import BASE_EXCEPTIONS
     14 from ..norm_exceptions import BASE_NORMS
---> 15 from ...language import Language
     16 from ...attrs import LANG, NORM
     17 from ...util import update_exc, add_lookups

~/anaconda3/lib/python3.7/site-packages/spacy/language.py in <module>
     16 from .vocab import Vocab
     17 from .lemmatizer import Lemmatizer
---> 18 from .pipeline import DependencyParser, Tensorizer, Tagger, EntityRecognizer
     19 from .pipeline import SimilarityHook, TextCategorizer, SentenceSegmenter
     20 from .pipeline import merge_noun_chunks, merge_entities

~/anaconda3/lib/python3.7/site-packages/spacy/pipeline/__init__.py in <module>
      2 from __future__ import unicode_literals
      3 
----> 4 from .pipes import Tagger, DependencyParser, EntityRecognizer
      5 from .pipes import TextCategorizer, Tensorizer, Pipe
      6 from .entityruler import EntityRuler

pipes.pyx in init spacy.pipeline.pipes()

ValueError: spacy.syntax.nn_parser.Parser size changed, may indicate binary incompatibility. Expected 72 from C header, got 64 from PyObject

My Environment: spaCy version: 2.0.16 Platform: Darwin-18.7.0-x86_64-i386-64bit Python version: 3.7.3 Models: en

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 16 (8 by maintainers)

Most upvoted comments

(base) graphikas-MacBook-Pro-4:~ lmcquillan$ python3 -m venv test1
(base) graphikas-MacBook-Pro-4:~ lmcquillan$ source test1/bin/activate
(test1) (base) graphikas-MacBook-Pro-4:~ lmcquillan$ pip list
Package    Version
---------- -------
pip        19.0.3 
setuptools 40.8.0 
You are using pip version 19.0.3, however version 19.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
(test1) (base) graphikas-MacBook-Pro-4:~ lmcquillan$ pip install spacy
Collecting spacy
  Downloading https://files.pythonhosted.org/packages/05/36/7459100c4ae5356b352b6ea2ef70d2549540f904bb12080977d62a892c76/spacy-2.2.1-cp37-cp37m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (14.0MB)
    100% |████████████████████████████████| 14.0MB 4.0MB/s 
Collecting numpy>=1.15.0 (from spacy)
  Using cached https://files.pythonhosted.org/packages/b4/e8/5ececadd9cc220bb783b4ce6ffaa9266925d37ed41237bc23bc530ab4f3d/numpy-1.17.2-cp37-cp37m-macosx_10_6_intel.whl
Collecting cymem<2.1.0,>=2.0.2 (from spacy)
  Using cached https://files.pythonhosted.org/packages/d7/11/37da628920bf2999bd8c4ffc40908413622486d5dbc4e60d87a58c428367/cymem-2.0.2-cp37-cp37m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Collecting wasabi<1.1.0,>=0.2.0 (from spacy)
  Using cached https://files.pythonhosted.org/packages/f4/c1/d76ccdd12c716be79162d934fe7de4ac8a318b9302864716dde940641a79/wasabi-0.2.2-py3-none-any.whl
Collecting plac<1.0.0,>=0.9.6 (from spacy)
  Using cached https://files.pythonhosted.org/packages/9e/9b/62c60d2f5bc135d2aa1d8c8a86aaf84edb719a59c7f11a4316259e61a298/plac-0.9.6-py2.py3-none-any.whl
Collecting blis<0.5.0,>=0.4.0 (from spacy)
  Downloading https://files.pythonhosted.org/packages/85/d8/f0be9d8ebec9cbeea1427de6ac0ecc919c0bfe881eff2d2965dbc310ca8b/blis-0.4.1-cp37-cp37m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (4.0MB)
    100% |████████████████████████████████| 4.0MB 12.3MB/s 
Collecting thinc<7.2.0,>=7.1.1 (from spacy)
  Downloading https://files.pythonhosted.org/packages/7d/10/a3200d2ff05098ed7f1fecea8a9503dcdeef7931bc6eae2787ce07454133/thinc-7.1.1-cp37-cp37m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (2.9MB)
    100% |████████████████████████████████| 2.9MB 10.7MB/s 
Collecting preshed<3.1.0,>=3.0.2 (from spacy)
  Downloading https://files.pythonhosted.org/packages/c7/3e/9aaba1f8c0cb69e57ebeb411cc1b65b3f6bfc3572dd68969a6d3e59288f6/preshed-3.0.2-cp37-cp37m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (211kB)
    100% |████████████████████████████████| 215kB 15.3MB/s 
Collecting murmurhash<1.1.0,>=0.28.0 (from spacy)
  Using cached https://files.pythonhosted.org/packages/b9/bd/faace403086ee922afc74e5615cb8c21020fcf5d5667314e943c08f71fde/murmurhash-1.0.2-cp37-cp37m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Collecting srsly<1.1.0,>=0.1.0 (from spacy)
  Downloading https://files.pythonhosted.org/packages/66/ab/a26c85fe8e4d416a482bdafa4ea36fb59add449f0d00ec45ab51036528e3/srsly-0.1.0-cp37-cp37m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (272kB)
    100% |████████████████████████████████| 276kB 28.3MB/s 
Collecting requests<3.0.0,>=2.13.0 (from spacy)
  Downloading https://files.pythonhosted.org/packages/51/bd/23c926cd341ea6b7dd0b2a00aba99ae0f828be89d72b2190f27c11d4b7fb/requests-2.22.0-py2.py3-none-any.whl (57kB)
    100% |████████████████████████████████| 61kB 20.4MB/s 
Collecting tqdm<5.0.0,>=4.10.0 (from thinc<7.2.0,>=7.1.1->spacy)
  Downloading https://files.pythonhosted.org/packages/e1/c1/bc1dba38b48f4ae3c4428aea669c5e27bd5a7642a74c8348451e0bd8ff86/tqdm-4.36.1-py2.py3-none-any.whl (52kB)
    100% |████████████████████████████████| 61kB 19.4MB/s 
Collecting idna<2.9,>=2.5 (from requests<3.0.0,>=2.13.0->spacy)
  Downloading https://files.pythonhosted.org/packages/14/2c/cd551d81dbe15200be1cf41cd03869a46fe7226e7450af7a6545bfc474c9/idna-2.8-py2.py3-none-any.whl (58kB)
    100% |████████████████████████████████| 61kB 23.1MB/s 
Collecting chardet<3.1.0,>=3.0.2 (from requests<3.0.0,>=2.13.0->spacy)
  Downloading https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl (133kB)
    100% |████████████████████████████████| 143kB 29.6MB/s 
Collecting certifi>=2017.4.17 (from requests<3.0.0,>=2.13.0->spacy)
  Downloading https://files.pythonhosted.org/packages/18/b0/8146a4f8dd402f60744fa380bc73ca47303cccf8b9190fd16a827281eac2/certifi-2019.9.11-py2.py3-none-any.whl (154kB)
    100% |████████████████████████████████| 163kB 30.3MB/s 
Collecting urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 (from requests<3.0.0,>=2.13.0->spacy)
  Downloading https://files.pythonhosted.org/packages/e0/da/55f51ea951e1b7c63a579c09dd7db825bb730ec1fe9c0180fc77bfb31448/urllib3-1.25.6-py2.py3-none-any.whl (125kB)
    100% |████████████████████████████████| 133kB 26.6MB/s 
Installing collected packages: numpy, cymem, wasabi, plac, blis, murmurhash, preshed, tqdm, srsly, thinc, idna, chardet, certifi, urllib3, requests, spacy
Successfully installed blis-0.4.1 certifi-2019.9.11 chardet-3.0.4 cymem-2.0.2 idna-2.8 murmurhash-1.0.2 numpy-1.17.2 plac-0.9.6 preshed-3.0.2 requests-2.22.0 spacy-2.2.1 srsly-0.1.0 thinc-7.1.1 tqdm-4.36.1 urllib3-1.25.6 wasabi-0.2.2
You are using pip version 19.0.3, however version 19.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

After this, I still hit the same error running from spacy.lang.en import English. and pip list returns the following:

(test1) (base) graphikas-MacBook-Pro-4:~ lmcquillan$ pip list
Package        Version  
-------------- ---------
blis           0.4.1    
certifi        2019.9.11
chardet        3.0.4    
cymem          2.0.2    
en-core-web-sm 2.2.0    
idna           2.8      
murmurhash     1.0.2    
numpy          1.17.2   
pip            19.0.3   
plac           0.9.6    
preshed        3.0.2    
requests       2.22.0   
setuptools     40.8.0   
spacy          2.2.1    
srsly          0.1.0    
thinc          7.1.1    
tqdm           4.36.1   
urllib3        1.25.6   
wasabi         0.2.2    
You are using pip version 19.0.3, however version 19.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.