jacksonllee / pycantonese

Cantonese Linguistics and NLP
https://pycantonese.org
MIT License
362 stars 39 forks source link

import error occurs when import pycantonese #27

Closed flippedkiki closed 3 years ago

flippedkiki commented 3 years ago

I first use pip to install pycantonese: pip install pycantonese

When I use "import pycantonese", the following error occured:


ImportError Traceback (most recent call last)

in ----> 1 import pycantonese as pc 2 3 import os 4 5 import re ~/anaconda3/lib/python3.7/site-packages/pycantonese/__init__.py in 1 import pkg_resources 2 ----> 3 from pycantonese.corpus import hkcancor, read_chat, CHATReader 4 from pycantonese.jyutping.characters import ( 5 characters_to_jyutping, ~/anaconda3/lib/python3.7/site-packages/pycantonese/corpus.py in 4 from typing import List, Optional, Union 5 ----> 6 from pylangacq.chat import Reader, _params_in_docstring 7 from pylangacq.chat import read_chat as pylangacq_read_chat 8 from pylangacq.objects import Gra ~/anaconda3/lib/python3.7/site-packages/pylangacq/__init__.py in 1 import pkg_resources 2 ----> 3 from pylangacq.chat import read_chat, Reader 4 5 ~/anaconda3/lib/python3.7/site-packages/pylangacq/chat.py in 21 from requests.packages.urllib3.util.retry import Retry 22 from dateutil.parser import parse as parse_date ---> 23 from dateutil.parser import ParserError 24 25 import pylangacq ImportError: cannot import name 'ParserError' from 'dateutil.parser' (/Users/libaiqi/anaconda3/lib/python3.7/site-packages/dateutil/parser/__init__.py)
flippedkiki commented 3 years ago

Solved by this method: https://stackoverflow.com/questions/37434917/python-error-importing-dateutil