Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error importing tag from pattern3.en

I have installed pattern3 with pip in a conda virtual environment. I am working in Windows 8.1 64-bit .When I try to execute

from pattern3.en import tag

I have the following errror:

Traceback (most recent call last):
  File "test_pattern.py", line 5, in <module>
    from pattern3.en import tag
  File "C:\Users\Rodolfo\Anaconda3\envs\flasky\lib\site-packages\pattern3\text\en\__init__.py", line 22, in <module>
    from pattern3.text import (
  File "C:\Users\Rodolfo\Anaconda3\envs\flasky\lib\site-packages\pattern3\text\__init__.py", line 28, in <module>
    from pattern3.text.tree import Tree, Text, Sentence, Slice, Chunk, PNPChunk, Chink, Word, table
  File "C:\Users\Rodolfo\Anaconda3\envs\flasky\lib\site-packages\pattern3\text\tree.py", line 37
    except:
         ^
IndentationError: expected an indented block

Any idea or help will be appreciated :)

like image 659
Rodolfo Alvarez Avatar asked Feb 06 '18 21:02

Rodolfo Alvarez


1 Answers

I solved the issue.
I received a message from Markus Beuckelmann (github) :
"...you are using the deprecated pattern3 repository which contains a completely different code base that is not maintained anymore. There is a development branch here on clips/pattern with Python 3 support. You can clone it, git clone -b development https://github.com/clips/pattern and install with pip or conda....."
However, I had many problems after cloning the repository and running python setup.py install
Finally, I was able to install pattern using:

pip install git+https://github.com/your_user_id/pattern.git@development

Where your_user_id is your github user id which is inserted automatically when the repository path is copied to the clipboard.

like image 95
Rodolfo Alvarez Avatar answered Sep 27 '22 20:09

Rodolfo Alvarez