malt parser gives assertion error when using it with nltk
Question: I am using malt parser with python nltk. I have successfully downloaded the
training data and updated the latest nltk. When I call the malt parser it
gives me an asertion error. Below is the code from python which includes the
traceback as well.

    
    
     mp = MaltParser("C:/Users/mustufain/Desktop/Python Files/maltparser-1.8.1","C:/Users/mustufain/Desktop/Python Files/maltparser-1.7.2",additional_java_args=['-Xmx512m'])
    
    Traceback (most recent call last):
      File "<pyshell#10>", line 1, in <module>
        mp = MaltParser("C:/Users/mustufain/Desktop/Python Files/maltparser-1.8.1","C:/Users/mustufain/Desktop/Python Files/maltparser-1.7.2",additional_java_args=['-Xmx512m'])
      File "C:\Python34\lib\site-packages\nltk\parse\malt.py", line 131, in __init__
        self.malt_jars = find_maltparser(parser_dirname)
      File "C:\Python34\lib\site-packages\nltk\parse\malt.py", line 72, in find_maltparser
        assert malt_dependencies.issubset(_jars)
    AssertionError
    >>> 
    


Answer: **`TL;DR`** (In **PYTHON3**!!):

    
    
    import urllib.request
    urllib.request.urlretrieve('http://www.maltparser.org/mco/english_parser/engmalt.poly-1.7.mco', 'C:\\Users\\mustufain\\Desktop\\engmalt.poly-1.7.mco')
    urllib.request.urlretrieve('http://maltparser.org/dist/maltparser-1.8.1.zip', 'C:\\Users\\mustufain\\Desktop\\maltparser-1.8.1.zip')
    zfile = zipfile.ZipFile('C:\\Users\\mustufain\\Desktop\\maltparser-1.8.1.zip')
    zfile.extractall('C:\\Users\\mustufain\\Desktop\\maltparser-1.8.1\\')
    

Then:

    
    
    from nltk.parse import malt
    mp = malt.MaltParser('C:\\Users\\mustufain\\Desktop\\maltparser-1.8.1\\', "C:\\Users\\mustufain\\Desktop\\engmalt.poly-1.7.mco")
    mp.parse_one('I shot an elephant in my pajamas .'.split()).tree()
    

