<h3 dir="auto">problem description</h3>
<p dir="auto">I was trying to learn lambda function of AWS,  I packaged library and source code to a deployment package and upload thme, so I can invoke it  .however ,when it comes to the matmul function ,it didn't work, I had try third version of numpy, none of them works,  python version is python3.7, numpy version is 1.16,1.18,1.19. the lambda code is very esay,<a href="https://github.com/kmu-bigdata/serverless-faas-workbench/blob/master/aws/cpu-memory/matmul/lambda_function.py">matmul function</a></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import numpy as np
from time import time


def matmul(n):
    A = np.random.rand(n, n)
    B = np.random.rand(n, n)

    start = time()
    C = np.matmul(A, B)
    latency = time() - start
    return latency


def lambda_handler(event, context):
    n = int(event['n'])
    result = matmul(n)
    print(result)
    return result"><pre class="notranslate"><code class="notranslate">import numpy as np
from time import time


def matmul(n):
    A = np.random.rand(n, n)
    B = np.random.rand(n, n)

    start = time()
    C = np.matmul(A, B)
    latency = time() - start
    return latency


def lambda_handler(event, context):
    n = int(event['n'])
    result = matmul(n)
    print(result)
    return result
</code></pre></div>
<p dir="auto">and this is the log cotent</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[ERROR] Runtime.ImportModuleError: Unable to import module 'lambda_function': 

IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

Importing the numpy c-extensions failed.
- Try uninstalling and reinstalling numpy.
- If you have already done that, then:
  1. Check that you expected to use Python3.7 from &quot;/var/lang/bin/python3.7&quot;,
     and that you have no directories in your PATH or PYTHONPATH that can
     interfere with the Python and numpy version &quot;1.18.0&quot; you're trying to use.
  2. If (1) looks fine, you can open a new issue at
     https://github.com/numpy/numpy/issues.  Please include details on:
     - how you installed Python
     - how you installed numpy
     - your operating system
     - whether or not you have multiple versions of Python installed
     - if you built from source, your compiler versions and ideally a build log

- If you're working with a numpy git repository, try `git clean -xdf`
  (removes all files not under version control) and rebuild numpy.

Note: this error has many possible causes, so please don't comment on
an existing issue about this - open a new one instead.

Original error was: No module named 'numpy.core._multiarray_umath'

END RequestId: c4fc9fea-2802-4ff0-b41c-ec014cad474b
REPORT RequestId: c4fc9fea-2802-4ff0-b41c-ec014cad474b	Duration: 1.57 ms	Billed Duration: 100 ms	Memory Size: 128 MB	Max Memory Used: 50 MB	"><pre class="notranslate"><code class="notranslate">[ERROR] Runtime.ImportModuleError: Unable to import module 'lambda_function': 

IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

Importing the numpy c-extensions failed.
- Try uninstalling and reinstalling numpy.
- If you have already done that, then:
  1. Check that you expected to use Python3.7 from "/var/lang/bin/python3.7",
     and that you have no directories in your PATH or PYTHONPATH that can
     interfere with the Python and numpy version "1.18.0" you're trying to use.
  2. If (1) looks fine, you can open a new issue at
     https://github.com/numpy/numpy/issues.  Please include details on:
     - how you installed Python
     - how you installed numpy
     - your operating system
     - whether or not you have multiple versions of Python installed
     - if you built from source, your compiler versions and ideally a build log

- If you're working with a numpy git repository, try `git clean -xdf`
  (removes all files not under version control) and rebuild numpy.

Note: this error has many possible causes, so please don't comment on
an existing issue about this - open a new one instead.

Original error was: No module named 'numpy.core._multiarray_umath'

END RequestId: c4fc9fea-2802-4ff0-b41c-ec014cad474b
REPORT RequestId: c4fc9fea-2802-4ff0-b41c-ec014cad474b	Duration: 1.57 ms	Billed Duration: 100 ms	Memory Size: 128 MB	Max Memory Used: 50 MB	
</code></pre></div>
<p dir="auto">is there anybody has idea?</p>
<ul dir="auto">
<li>how you installed Python<br>
deleted python3 on my mac and then <code class="notranslate">brew install python</code> to install python 3.7.3</li>
<li>how you installed numpy<br>
Since I am installing to run on AWS Lambda, <code class="notranslate">pip install numpy --target .</code></li>
<li>your operating system<br>
macOS Sierra 10.12.6</li>
<li>whether or not you have multiple versions of Python installed<br>
the native python 2.7.10 is still installed on my mac</li>
<li>if you built from source, your compiler versions and ideally a build log<br>
N/A</li>
</ul>
<p dir="auto">So I am able to run my code locally and I have no issues. I am pandas, matplotlib, boto3, and mpld3 to organize and display data in an AWS DDB table with matplotlib graphs that mpld3 turns into html. numpy appears to be needed for pandas, and whenever I try to install these libraries to a target directory so they can run in a lambda function, according to <a href="https://docs.aws.amazon.com/lambda/latest/dg/lambda-python-how-to-create-deployment-package.html" rel="nofollow">https://docs.aws.amazon.com/lambda/latest/dg/lambda-python-how-to-create-deployment-package.html</a>, I get the following error:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="
Importing the multiarray numpy extension module failed.  Most
likely you are trying to import a failed build of numpy.
Here is how to proceed:
- If you're working with a numpy git repository, try `git clean -xdf`
  (removes all files not under version control) and rebuild numpy.
- If you are simply trying to use the numpy version that you have installed:
  your installation is broken - please reinstall numpy.
- If you have already reinstalled and that did not fix the problem, then:
  1. Check that you are using the Python you expect (you're using /var/lang/bin/python3.6),
     and that you have no directories in your PATH or PYTHONPATH that can
     interfere with the Python and numpy versions you're trying to use.
  2. If (1) looks fine, you can open a new issue at
     https://github.com/numpy/numpy/issues.  Please include details on:
     - how you installed Python
     - how you installed numpy
     - your operating system
     - whether or not you have multiple versions of Python installed
     - if you built from source, your compiler versions and ideally a build log

     Note: this error has many possible causes, so please don't comment on
     an existing issue about this - open a new one instead.

Original error was: No module named 'numpy.core._multiarray_umath'


END RequestId: 2fc65f50-420d-441b-930c-665b1c8ab3ea
REPORT RequestId: 2fc65f50-420d-441b-930c-665b1c8ab3ea	Duration: 0.85 ms	Billed Duration: 100 ms 	Memory Size: 128 MB	Max Memory Used: 40 MB	```
  "><pre lang="IMPORTANT:" class="notranslate"><code class="notranslate">
Importing the multiarray numpy extension module failed.  Most
likely you are trying to import a failed build of numpy.
Here is how to proceed:
- If you're working with a numpy git repository, try `git clean -xdf`
  (removes all files not under version control) and rebuild numpy.
- If you are simply trying to use the numpy version that you have installed:
  your installation is broken - please reinstall numpy.
- If you have already reinstalled and that did not fix the problem, then:
  1. Check that you are using the Python you expect (you're using /var/lang/bin/python3.6),
     and that you have no directories in your PATH or PYTHONPATH that can
     interfere with the Python and numpy versions you're trying to use.
  2. If (1) looks fine, you can open a new issue at
     https://github.com/numpy/numpy/issues.  Please include details on:
     - how you installed Python
     - how you installed numpy
     - your operating system
     - whether or not you have multiple versions of Python installed
     - if you built from source, your compiler versions and ideally a build log

     Note: this error has many possible causes, so please don't comment on
     an existing issue about this - open a new one instead.

Original error was: No module named 'numpy.core._multiarray_umath'


END RequestId: 2fc65f50-420d-441b-930c-665b1c8ab3ea
REPORT RequestId: 2fc65f50-420d-441b-930c-665b1c8ab3ea	Duration: 0.85 ms	Billed Duration: 100 ms 	Memory Size: 128 MB	Max Memory Used: 40 MB	```
  
</code></pre></div>