question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ModuleNotFoundError: No module named 'thinc.neural.util'

See original GitHub issue

I installed spaCy on my Mac OSX 10.11.6 into an Anaconda Python 3.6 environment with conda. I also was able to build thinc from source with ‘fab’.

$ conda --version
conda 4.3.29
$ python --version
Python 3.6.3
$ fab --version
Fabric 1.14.0
Paramiko 2.3.1

When I try to install the spaCy model I get this error:

 python -m sense2vec.download

ModuleNotFoundError: No module named ‘thinc.neural.util’

I see util.py in thinc.neural package on github. There must be a conflict or version mismatch with what I downloaded from conda and what is in the latest version of ‘thinc’ on github. Any ideas?

From Conda: spacy: 2.0.4-py36_0 conda-forge thinc: 6.10.0-py36_0 conda-forge

$ conda list thinc
# packages in environment at /Users/davidlaxer/anaconda/envs/py36:
#
thinc                     6.10.2                    <pip>
thinc                     6.10.0                   py36_0    conda-forge
thinc                     5.0.8                     <pip>
(py36) David-Laxers-MacBook-Pro:sense2vec davidlaxer$ conda list spacy
# packages in environment at /Users/davidlaxer/anaconda/envs/py36:
#
spacy                     2.0.5                     <pip>
spacy                     2.0.4                    py36_0    conda-forge
spacy                     0.101.0                   <pip>
(py36) David-Laxers-MacBook-Pro:sense2vec davidlaxer$ python -m spacy validate
Traceback (most recent call last):
  File "/Users/davidlaxer/anaconda/envs/py36/lib/python3.6/runpy.py", line 183, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "/Users/davidlaxer/anaconda/envs/py36/lib/python3.6/runpy.py", line 142, in _get_module_details
    return _get_module_details(pkg_main_name, error)
  File "/Users/davidlaxer/anaconda/envs/py36/lib/python3.6/runpy.py", line 109, in _get_module_details
    __import__(pkg_name)
  File "/Users/davidlaxer/anaconda/envs/py36/lib/python3.6/site-packages/spacy/__init__.py", line 4, in <module>
    from .cli.info import info as cli_info
  File "/Users/davidlaxer/anaconda/envs/py36/lib/python3.6/site-packages/spacy/cli/__init__.py", line 1, in <module>
    from .download import download
  File "/Users/davidlaxer/anaconda/envs/py36/lib/python3.6/site-packages/spacy/cli/download.py", line 10, in <module>
    from .link import link
  File "/Users/davidlaxer/anaconda/envs/py36/lib/python3.6/site-packages/spacy/cli/link.py", line 7, in <module>
    from ..compat import symlink_to, path2str
  File "/Users/davidlaxer/anaconda/envs/py36/lib/python3.6/site-packages/spacy/compat.py", line 11, in <module>
    from thinc.neural.util import copy_array
ModuleNotFoundError: No module named 'thinc.neural.util'


Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
dbl001commented, Dec 26, 2017

I created a new python 3.6 virtual environment with conda and tried installing spacy with conda from scratch:

$ conda create -n spacy python=3.6 anaconda 
Fetching package metadata .............
Solving package specifications: .

Package plan for installation in environment /Users/davidlaxer/anaconda/envs/spacy:

The following NEW packages will be INSTALLED:

    anaconda:        custom-py36ha4fed55_0            
    ca-certificates: 2017.11.5-0           conda-forge
    certifi:         2017.11.5-py36_0      conda-forge
    ncurses:         5.9-10                conda-forge
    openssl:         1.0.2n-0              conda-forge
    pip:             9.0.1-py36_0          conda-forge
    python:          3.6.4-0               conda-forge
    readline:        7.0-0                 conda-forge
    setuptools:      38.2.4-py36_0         conda-forge
    sqlite:          3.20.1-2              conda-forge
    tk:              8.6.7-0               conda-forge
    wheel:           0.30.0-py_1           conda-forge
    xz:              5.2.3-0               conda-forge
    zlib:            1.2.11-0              conda-forge

Proceed ([y]/n)? y

sqlite-3.20.1- 100% |################################| Time: 0:00:02 664.49 kB/s
python-3.6.4-0 100% |################################| Time: 0:00:04   2.59 MB/s
anaconda-custo 100% |################################| Time: 0:00:00   3.88 MB/s
#
# To activate this environment, use:
# > source activate spacy
#
# To deactivate an active environment, use:
# > source deactivate
#

David-Laxers-MacBook-Pro:~ davidlaxer$ source activate spacy
(spacy) David-Laxers-MacBook-Pro:~ davidlaxer$ conda install ipython
Fetching package metadata .............
Solving package specifications: .

Package plan for installation in environment /Users/davidlaxer/anaconda/envs/spacy:

The following NEW packages will be INSTALLED:

    appnope:          0.1.0-py36_0  conda-forge
    decorator:        4.1.2-py36_0  conda-forge
    ipython:          6.2.1-py36_0  conda-forge
    ipython_genutils: 0.2.0-py36_0  conda-forge
    jedi:             0.10.2-py36_0 conda-forge
    pexpect:          4.3.1-py36_0  conda-forge
    pickleshare:      0.7.4-py36_0  conda-forge
    prompt_toolkit:   1.0.15-py36_0 conda-forge
    ptyprocess:       0.5.2-py36_0  conda-forge
    pygments:         2.2.0-py36_0  conda-forge
    simplegeneric:    0.8.1-py36_0  conda-forge
    six:              1.11.0-py36_1 conda-forge
    traitlets:        4.3.2-py36_0  conda-forge
    wcwidth:          0.1.7-py36_0  conda-forge

Proceed ([y]/n)? y

(spacy) David-Laxers-MacBook-Pro:~ davidlaxer$ conda install spacy
Fetching package metadata .............
Solving package specifications: .

Package plan for installation in environment /Users/davidlaxer/anaconda/envs/spacy:

The following NEW packages will be INSTALLED:

    asn1crypto:     0.22.0-py36_0         conda-forge
    cffi:           1.11.2-py36_0         conda-forge
    chardet:        3.0.4-py36_0          conda-forge
    cryptography:   2.1.4-py36_0          conda-forge
    cymem:          1.31.2-py36_0         conda-forge
    cytoolz:        0.8.2-py36_0          conda-forge
    dill:           0.2.6-py36_0          conda-forge
    ftfy:           4.4.2-py36_0          conda-forge
    html5lib:       1.0.1-py_0            conda-forge
    idna:           2.6-py36_1            conda-forge
    intel-openmp:   2018.0.0-h8158457_8              
    libffi:         3.2.1-3               conda-forge
    libgfortran:    3.0.1-h93005f0_2                 
    mkl:            2018.0.1-hfbd8650_4              
    msgpack-numpy:  0.4.1-py_0            conda-forge
    msgpack-python: 0.4.8-py36_0          conda-forge
    murmurhash:     0.28.0-py36_0                    
    numpy:          1.13.3-py36h2cdce51_0            
    plac:           0.9.6-py36_0          conda-forge
    preshed:        1.0.0-py36_0          conda-forge
    pycparser:      2.18-py36_0           conda-forge
    pyopenssl:      17.4.0-py36_0         conda-forge
    pysocks:        1.6.7-py36_0          conda-forge
    regex:          2017.11.09-py36_0     conda-forge
    requests:       2.18.4-py36_1         conda-forge
    spacy:          2.0.4-py36_0          conda-forge
    termcolor:      1.1.0-py36_1          conda-forge
    thinc:          6.10.0-py36_0         conda-forge
    toolz:          0.8.2-py_2            conda-forge
    tqdm:           4.19.5-py_0           conda-forge
    ujson:          1.35-py36_0           conda-forge
    urllib3:        1.22-py36_0           conda-forge
    webencodings:   0.5-py36_0            conda-forge
    wrapt:          1.10.11-py36_0        conda-forge

Proceed ([y]/n)? y

tqdm-4.19.5-py 100% |################################| Time: 0:00:00 173.60 kB/s
(spacy) David-Laxers-MacBook-Pro:~ davidlaxer$ python -m spacy.en.download
Traceback (most recent call last):
  File "/Users/davidlaxer/anaconda/envs/spacy/lib/python3.6/runpy.py", line 183, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "/Users/davidlaxer/anaconda/envs/spacy/lib/python3.6/runpy.py", line 109, in _get_module_details
    __import__(pkg_name)
  File "/Users/davidlaxer/anaconda/envs/spacy/lib/python3.6/site-packages/spacy/__init__.py", line 4, in <module>
    from .cli.info import info as cli_info
  File "/Users/davidlaxer/anaconda/envs/spacy/lib/python3.6/site-packages/spacy/cli/__init__.py", line 1, in <module>
    from .download import download
  File "/Users/davidlaxer/anaconda/envs/spacy/lib/python3.6/site-packages/spacy/cli/download.py", line 10, in <module>
    from .link import link
  File "/Users/davidlaxer/anaconda/envs/spacy/lib/python3.6/site-packages/spacy/cli/link.py", line 7, in <module>
    from ..compat import symlink_to, path2str
  File "/Users/davidlaxer/anaconda/envs/spacy/lib/python3.6/site-packages/spacy/compat.py", line 11, in <module>
    from thinc.neural.util import copy_array
  File "/Users/davidlaxer/anaconda/envs/spacy/lib/python3.6/site-packages/thinc/neural/__init__.py", line 1, in <module>
    from ._classes.model import Model
  File "/Users/davidlaxer/anaconda/envs/spacy/lib/python3.6/site-packages/thinc/neural/_classes/model.py", line 12, in <module>
    from ..train import Trainer
  File "/Users/davidlaxer/anaconda/envs/spacy/lib/python3.6/site-packages/thinc/neural/train.py", line 3, in <module>
    from .optimizers import Adam, SGD, linear_decay
  File "optimizers.pyx", line 13, in init thinc.neural.optimizers
  File "ops.pyx", line 1, in init thinc.neural.ops
ImportError: murmurhash.mrmr does not export expected C function hash128_x86
1reaction
userofgithub1commented, Jun 30, 2018

I solved the problem by updating Spyder.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ModuleNotFoundError: No module named 'thinc.neural'
Since a few versions ago thinc was reorganized. Classes and functions should now be imported from thinc.api .
Read more >
ModuleNotFoundError: No module named 'thinc' - RoseIndia.Net
Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'thinc' How to remove the ModuleNotFou.
Read more >
No module named 'thinc.types' error - solved - Prodigy Support
In my Dockerfile I ran a pip install thinc --pre as suggested in the documentation, and notice that in my jupyter notebook, I...
Read more >
thinc - PyPI
Thinc is a lightweight deep learning library that offers an elegant, type-checked, functional-programming API for composing models, with support for layers ...
Read more >
explosion/spaCy - Gitter
I installed spacy, thinc with gpu support . I have installed cupy from Chainer as well. ... ModuleNotFoundError: No module named 'thinc.neural.gpu_ops'.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found