原文链接:http://www.one2know.cn/bug5/
- 报错
Traceback (most recent call last):
File "D:/PyCharm 5.0.3/WorkSpace/2.NLP/8.高阶实践/1.PipelineQ.py", line 1, in
import nltk
File "D:Anaconda3libsite-packages ltk_init_.py", line 143, in
from nltk.chunk import *
File "D:Anaconda3libsite-packages ltkchunk_init_.py", line 157, in
from nltk.chunk.api import ChunkParserI
File "D:Anaconda3libsite-packages ltkchunkapi.py", line 13, in
from nltk.parse import ParserI
File "D:Anaconda3libsite-packages ltkparse_init_.py", line 100, in
from nltk.parse.transitionparser import TransitionParser
File "D:Anaconda3libsite-packages ltkparse ransitionparser.py", line 22, in
from sklearn.datasets import load_svmlight_file
File "D:Python37Libsite-packagessklearn_init_.py", line 76, in
from .base import clone
File "D:Python37Libsite-packagessklearnase.py", line 16, in
from .utils import IS_32BIT
File "D:Python37Libsite-packagessklearnutils_init.py", line 17, in
from . import joblib
File "D:Python37Libsite-packagessklearnutils_joblib.py", line 8, in .py", line 119, in
import joblib
File "D:Python37Libsite-packagesjoblib_init
from .parallel import Parallel
File "D:Python37Libsite-packagesjoblibparallel.py", line 28, in
from ._parallel_backends import (FallbackToBackend, MultiprocessingBackend,
File "D:Python37Libsite-packagesjoblib_parallel_backends.py", line 20, in
from .pool import MemmappingPool
File "D:Python37Libsite-packagesjoblibpool.py", line 33, in
from ._memmapping_reducer import get_memmapping_reducers
File "D:Python37Libsite-packagesjoblib_memmapping_reducer.py", line 17, in
from uuid import uuid4
File "D:Python37Libsite-packagesuuid.py", line 138
if not 0 <= time_low < 1<<32L:
SyntaxError: invalid syntax
- 原因
uuid版本不对,导致语法错误 - 解决
在系统命令行卸载uuid:
pip uninstall uuid
在Anacanda3中重新安装:
pip install uuid