SPACY IMPORT ERROR!
See original GitHub issueHow to reproduce the problem
“I’ve tried updating new versions of thinc and spacy as directed from previous issue posts.” Its flagging a import error.
# copy-paste the error message here
ImportError Traceback (most recent call last) <ipython-input-8-cb604e7f192b> in <module> 1 import pandas as pd 2 import string ----> 3 import spacy 4 from collections import Counter 5 from spacy.lang.en import English
~/opt/anaconda3/lib/python3.7/site-packages/spacy/init.py in <module> 8 9 # These are imported as part of the API —> 10 from thinc.api import prefer_gpu, require_gpu # noqa: F401 11 from thinc.api import Config 12
ImportError: cannot import name ‘prefer_gpu’ from ‘thinc.api’ (/Users/lexroverts/opt/anaconda3/lib/python3.7/site-packages/thinc/api.py)
Your Environment
- Operating System:IOS Mac
- Python Version Used: 3.7.6
- spaCy Version Used: 2.1.8
- Environment Information:
I need help trying to get spacy to work again on Jupiter notebooks.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:8 (4 by maintainers)
Top GitHub Comments
pip
lets you update packages even if this might cause conflicts with other currently installed packages. Notice the warnings at the bottom of the install message that show which packages are incompatible. Updatingthinc
independently fromspacy
can lead to mismatches. (In general it’s easier for us to help if the errors are pasted as text in a code block instead of as images, thanks!)You may be able to fix your current virtual environment with
pip install spacy==2.3.2
. You also don’t want to havespacy
andspacy-nightly
installed in the same environment, so please uninstall withpip uninstall spacy-nightly
. (Unless you want the prerelease version, then uninstallspacy
and follow install instructions here: https://nightly.spacy.io/usage)If that doesn’t work, we’d recommend starting with a new virtual environment and just installing spacy (
pip install spacy
, optionally with the stable version you’d like), which will pull in the correct versions of all the dependencies.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.