pattern icon indicating copy to clipboard operation
pattern copied to clipboard

Error importing pattern3.en

Open jt4000 opened this issue 6 years ago • 2 comments

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

jt4000 avatar Oct 28 '18 18:10 jt4000

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.)

jhortle avatar Dec 03 '18 23:12 jhortle

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.

PS-Ddevil avatar Feb 01 '20 17:02 PS-Ddevil