The "pattern" package for python 3.6 Anaconda

I have an Anaconda environment on my machine for python 3.6. When I try to install the package template via pip, it gave an error saying something like

parentheses around print n

Then I tried conda install -c asmeurer pattern=2.5; as well as conda install -c asmeurer pattern . It says:

UnsatisfiableError: The following specifications were found to conflict: - pattern -> python 2.7 * - python 3.6 * "

Finally, I found out that python 3 does not have a template directly.

So, I tried to download the zip template from http://www.clips.ua.ac.be/pattern . Now that I have run python ./setup.py install . It again gives errors related to parentheses around print n

I tried almost everything, but could not install the template package in my python 3.6 Anaconda environment. Can someone please help me here, some workaround for this?

+5
source share
2 answers

I installed PIP using Conda

 conda install pip 

and then set the template with

 pip install Pattern3 

he worked:)

+4
source

I'm not sure how this relates to Anaconda, but it helped me get pattern.en working in python 3.6 :

 git clone -b development https://github.com/clips/pattern cd pattern sudo python3.6 setup.py install 

https://github.com/clips/pattern/issues/62

I had some SSL errors during installation on my mac (10.11.6) that were fixed by running this code in python (3.6):

 import nltk import ssl try: _create_unverified_https_context = ssl._create_unverified_context except AttributeError: pass else: ssl._create_default_https_context = _create_unverified_https_context nltk.download('wordnet_ic') 

obviously there is a better way to handle an ssl file like this fwiw: fooobar.com/questions/265446 / ...

health check:

 user@USDR00253 ~> python3.6 Python 3.6.4 (v3.6.4:d48ecebad5, Dec 18 2017, 21:07:28) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> >>> from pattern.en import conjugate, lemma, lexeme, parse >>> >>> print(parse('ridden', relations=True, lemmata=True)) ridden/VBN/B-VP/O/O/ride >>> 

pattern.en finally launched in python3!

+3
source

Source: https://habr.com/ru/post/1268310/


All Articles