TypeError: 'module' object is not callable in Spacy Python
<p>I want to print <code>Parse Tree</code> using <code>Spacy</code>. But the code below is giving the error </p>

<blockquote>
  <p>en_nlp = spacy.language('English')
  TypeError: 'module' object is not callable</p>
</blockquote>

<p>The error is on this <code>en_nlp = spacy.loads('en')</code> line. I tried to shake off as <code>en_nlp = spacy.language(English)</code> by importing <code>from spacy.en import English</code> But still it is not working. Can someone help?</p>

<p>Code: </p>

<pre><code>import spacy
from nltk import Tree

en_nlp = spacy.loads('en')

doc = en_nlp("The quick brown fox jumps over the lazy dog.")

def to_nltk_tree(node):
    if node.n_lefts + node.n_rights &gt; 0:
        return Tree(node.orth_, [to_nltk_tree(child) for child in node.children])
    else:
        return node.orth_


[to_nltk_tree(sent.root).pretty_print() for sent in doc.sents]
</code></pre>

<pre><code>Is it spacy.load('en') or spacy.loads('en') ?
</code></pre>

<p>The official doc <a href="https://spacy.io/docs/" rel="nofollow">https://spacy.io/docs/</a> says : 
    spacy.load('en').
    It may be the problem.</p>

python nlp spacy