clips / pattern

Web mining module for Python, with tools for scraping, natural language processing, machine learning, network analysis and visualization.
https://github.com/clips/pattern/wiki
BSD 3-Clause "New" or "Revised" License
8.75k stars 1.58k forks source link

Error importing pattern3.en #248

Open jt4000 opened 6 years ago

jt4000 commented 6 years ago

I'm using Anaconda and i retrieve this message "IndentationError: expected an indented block" when I apply this code "from pattern3.en import tag"

bild3

jhortle commented 5 years ago

After running into the same problem (using Pip 18.1 and installing with pip3 install pattern3), it seems like the file pattern3/text/tree.py on GitHub and the file on PyPI are different.

If you just replace tree.py with the GitHub version, the IndentationError goes away and you can import the package. (This doesn't guarantee the correctness of the package, however.)

PS-Ddevil commented 4 years ago

In case anyone still have issue, you can run the command

sed -i '36s/.*/ pass/' /usr/local/lib/python3.6/dist-packages/pattern3/text/tree.py

I was using a dockerfile for the project so did the same, you can change it manually otherwise.