<p dir="auto">Importing numpy raises AttributeError when using latest version, 1.16.0.</p>
<h3 dir="auto">Reproducing code example:</h3>
<p dir="auto">import numpy as np</p>
<h2 dir="auto">Gives error traceback:</h2>
<hr>
<p dir="auto">AttributeError                            Traceback (most recent call last)<br>
 in <br>
----&gt; 1 from sklearn.datasets import make_classification<br>
2 from sklearn.preprocessing import StandardScaler,label_binarize<br>
3 from sklearn.svm import SVC, LinearSVC<br>
4 from sklearn.multiclass import OneVsRestClassifier<br>
5 from sklearn.pipeline import make_pipeline</p>
<p dir="auto">~/.local/lib/python3.6/site-packages/sklearn/<strong>init</strong>.py in <br>
62 else:<br>
63     from . import __check_build<br>
---&gt; 64     from .base import clone<br>
65     from .utils._show_versions import show_versions<br>
66</p>
<p dir="auto">~/.local/lib/python3.6/site-packages/sklearn/base.py in <br>
8 from collections import defaultdict<br>
9<br>
---&gt; 10 import numpy as np<br>
11 from scipy import sparse<br>
12 from .externals import six</p>
<p dir="auto">~/.local/lib/python3.6/site-packages/numpy/<strong>init</strong>.py in <br>
140     from . import _distributor_init<br>
141<br>
--&gt; 142     from . import core<br>
143     from .core import *<br>
144     from . import compat</p>
<p dir="auto">~/.local/lib/python3.6/site-packages/numpy/core/<strong>init</strong>.py in <br>
57 from . import numerictypes as nt<br>
58 multiarray.set_typeDict(nt.sctypeDict)<br>
---&gt; 59 from . import numeric<br>
60 from .numeric import *<br>
61 from . import fromnumeric</p>
<p dir="auto">~/.local/lib/python3.6/site-packages/numpy/core/numeric.py in <br>
3091 from .umath import *<br>
3092 from .numerictypes import *<br>
-&gt; 3093 from . import fromnumeric<br>
3094 from .fromnumeric import *<br>
3095 from . import arrayprint</p>
<p dir="auto">~/.local/lib/python3.6/site-packages/numpy/core/fromnumeric.py in <br>
15 from . import numerictypes as nt<br>
16 from .numeric import asarray, array, asanyarray, concatenate<br>
---&gt; 17 from . import _methods<br>
18<br>
19 <em>dt</em> = nt.sctype2char</p>
<p dir="auto">~/.local/lib/python3.6/site-packages/numpy/core/_methods.py in <br>
156     )<br>
157<br>
--&gt; 158 _NDARRAY_ARRAY_FUNCTION = mu.ndarray.<strong>array_function</strong><br>
159<br>
160 def _array_function(self, func, types, args, kwargs):</p>
<p dir="auto">AttributeError: type object 'numpy.ndarray' has no attribute '<strong>array_function</strong>'</p>
<p dir="auto">I pip installed the latest numpy and get the below error. The error goes away if I roll back to v1.15.4.<br>
The most closely related issue I could find is <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="363344806" data-permission-text="Title is private" data-url="https://github.com/numpy/numpy/issues/12028" data-hovercard-type="issue" data-hovercard-url="/numpy/numpy/issues/12028/hovercard" href="https://github.com/numpy/numpy/issues/12028">#12028</a>.</p>
<h3 dir="auto">Reproducing code example:</h3>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import numpy as np"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">numpy</span> <span class="pl-k">as</span> <span class="pl-s1">np</span></pre></div>
<h3 dir="auto">Error message:</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="    Traceback (most recent call last):
      File &quot;/home/trey/script.py&quot;, line 6, in &lt;module&gt;
        import numpy as np
      File &quot;/home/trey/.local/lib/python3.6/site-packages/numpy/__init__.py&quot;, line 142, in &lt;module&gt;
        from . import core
      File &quot;/home/trey/.local/lib/python3.6/site-packages/numpy/core/__init__.py&quot;, line 59, in &lt;module&gt;
        from . import numeric
      File &quot;/home/trey/.local/lib/python3.6/site-packages/numpy/core/numeric.py&quot;, line 3093, in &lt;module&gt;
        from . import fromnumeric
      File &quot;/home/trey/.local/lib/python3.6/site-packages/numpy/core/fromnumeric.py&quot;, line 17, in &lt;module&gt;
        from . import _methods
      File &quot;/home/trey/.local/lib/python3.6/site-packages/numpy/core/_methods.py&quot;, line 158, in &lt;module&gt;
        _NDARRAY_ARRAY_FUNCTION = mu.ndarray.__array_function__
    AttributeError: type object 'numpy.ndarray' has no attribute '__array_function__'"><pre class="notranslate"><code class="notranslate">    Traceback (most recent call last):
      File "/home/trey/script.py", line 6, in &lt;module&gt;
        import numpy as np
      File "/home/trey/.local/lib/python3.6/site-packages/numpy/__init__.py", line 142, in &lt;module&gt;
        from . import core
      File "/home/trey/.local/lib/python3.6/site-packages/numpy/core/__init__.py", line 59, in &lt;module&gt;
        from . import numeric
      File "/home/trey/.local/lib/python3.6/site-packages/numpy/core/numeric.py", line 3093, in &lt;module&gt;
        from . import fromnumeric
      File "/home/trey/.local/lib/python3.6/site-packages/numpy/core/fromnumeric.py", line 17, in &lt;module&gt;
        from . import _methods
      File "/home/trey/.local/lib/python3.6/site-packages/numpy/core/_methods.py", line 158, in &lt;module&gt;
        _NDARRAY_ARRAY_FUNCTION = mu.ndarray.__array_function__
    AttributeError: type object 'numpy.ndarray' has no attribute '__array_function__'
</code></pre></div>
<h3 dir="auto">Numpy/Python version information:</h3>
<p dir="auto">1.16.0<br>
3.6.7 (default, Oct 22 2018, 11:32:17)<br>
[GCC 8.2.0]</p>