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

ImportError: cannot import name util #64

Closed
userofgithub1 opened this issue May 27, 2018 · 1 comment
Closed

ImportError: cannot import name util #64

userofgithub1 opened this issue May 27, 2018 · 1 comment

Comments

@userofgithub1
Copy link

Hey,
I'm having issues when importing spaCy in python (v2.7) which doesn't appear when using it in ipython (v5.4.1). I used to have spaCy 2.0.11 then I reinstalled 2.0.7 and the issue remains. Some useful info about the spaCy model and python version I have :

Python version     2.7.14         
    Platform           Darwin-15.5.0-x86_64-i386-64bit
    spaCy version      2.0.7          
    Location           /Users/AMAL/anaconda2/lib/python2.7/site-packages/spacy
    Models             en_core_web_sm, en_default

Thinc version:

Name: thinc
Version: 6.10.2

Doing import spacy in ipython doesnt cause any problems, using python interpreter in terminal:

python
Python 2.7.14 |Anaconda custom (64-bit)| (default, Oct  5 2017, 02:28:52) 
[GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import spacy
>>> import thinc
>>> import thinc.neural
>>> exit()

However, doing that in python spyder IDE throws this error:

spacy/cli/__init__.py", line 1, in <module>
    from .download import download

  File "/Users/AMAL/anaconda2/lib/python2.7/site-packages/spacy/cli/download.py", line 10, in <module>
    from .link import link

  File "/Users/AMAL/anaconda2/lib/python2.7/site-packages/spacy/cli/link.py", line 7, in <module>
    from ..compat import symlink_to, path2str

  File "/Users/AMAL/anaconda2/lib/python2.7/site-packages/spacy/compat.py", line 11, in <module>
    from thinc.neural.util import copy_array

  File "/Users/AMAL/anaconda2/lib/python2.7/site-packages/thinc/neural/__init__.py", line 1, in <module>
    from ._classes.model import Model

  File "/Users/AMAL/anaconda2/lib/python2.7/site-packages/thinc/neural/_classes/model.py", line 11, in <module>
    from .. import util

ImportError: cannot import name util

How can I fix this problem? I'm super interested in including spaCy in my work, so any help will be truly appreciated.

Best regards,

@honnibal
Copy link
Member

I'm pretty sure you've installed the library into the wrong copy of Python. I don't use the Spyder IDE and can't support it, so I don't know exactly what you might have done wrong. But I doubt the problem is specific to spaCy or Thinc, sorry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants