虽然我能够在windows python3 anaconda环境中安装spacy,但我无法下载英文模块
C:\Users\Smith>activate myenvt (myenvt) C:\Users\Smith> **python -m spacy download en** Traceback (most recent call last): File "C:\Users\Smith\Anaconda2\envs\myenvt\lib\runpy.py", line 183, in run_module_as_main mod_name, mod_spec, code = _get_module_details(mod_name, _Error) File "C:\Users\Smith\Anaconda2\envs\myenvt\lib\runpy.py", line 142, in _get_module_details return _get_module_details(pkg_main_name, error) File "C:\Users\Smith\Anaconda2\envs\myenvt\lib\runpy.py", line 109, in _get_module_details __import__(pkg_name) File "C:\Users\Smith\Anaconda2\envs\myenvt\lib\site- packages\pip\__init__.py", line 28, in from pip.vcs import git, mercurial, subversion, bazaar # noqa File "C:\Users\Smith\Anaconda2\envs\myenvt\lib\site- packages\pip\vcs\mercurial.py", line 9, in from pip.download import path_to_url File "C:\Users\Smith\Anaconda2\envs\myenvt\lib\site- packages\pip\download.py", line 34, in from pip.utils.logging import indent_log File "C:\Users\Smith\Anaconda2\envs\myenvt\lib\site- packages\pip\utils\logging.py", line 66, in class ColorizedStreamHandler(logging.StreamHandler): File "C:\Users\Smith\Anaconda2\envs\myenvt\lib\site- packages\pip\utils\logging.py", line 72, in ColorizedStreamHandler (logging.ERROR, _color_wrap(colorama.Fore.RED)), AttributeError: module 'pip._vendor.colorama' has no attribute 'Fore'
我试图通过遵循以下建议来克服这个问题: spacy module install in conda
1)从github手动下载英语模块 2)链接到下载
但是,当我运行此代码时
import spacy
nlp = spacy.load('en')
第二行给出了以下错误
runfile('C:/Users/Smith/DS/nlp1.py', wdir='C:/Users/Smith/DS') Traceback (most recent call last): File "", line 1, in runfile('C:/Users/Smith/DS/nlp1.py', wdir='C:/Users/Smith/DS') File "C:\Users\Smith\Anaconda2\envs\myenvt\lib\site-packages\spyder\utils\site\sitecustomize.py", line 710, in runfile execfile(filename, namespace) File "C:\Users\Smith\Anaconda2\envs\myenvt\lib\site-packages\spyder\utils\site\sitecustomize.py", line 101, in execfile exec(compile(f.read(), filename, 'exec'), namespace) File "C:/Users/Smith/DS/nlp1.py", line 11, in nlp = spacy.load('en') File "C:\Users\Smith\Anaconda2\envs\myenvt\lib\site-packages\spacy\__init__.py", line 19, in load return util.load_model(name, **overrides) File "C:\Users\Smith\Anaconda2\envs\myenvt\lib\site-packages\spacy\util.py", line 112, in load_model return load_model_from_link(name, **overrides) File "C:\Users\Smith\Anaconda2\envs\myenvt\lib\site-packages\spacy\util.py", line 131, in load_model_from_link return cls.load(**overrides) AttributeError: module 'en' has no attribute 'load'