title: Running Lambda Function written in Go on AWS - error while loading shared libraries
body: <p>My question is similar to: <a href="https://stackoverflow.com/questions/57096379/libtensorflow-so-cannot-open-shared-object-file-no-such-file-or-directory">libtensorflow.so: cannot open shared object file: No such file or directory</a> but I do not see an answer for it, so I would appreciate any kind of help.</p>
  
  <p>Once I print my <strong>LD_LIBRARY_PATH</strong> I get the following output:</p>
  
  <pre><code>/lib64:/usr/lib64:/var/runtime:/var/runtime/lib:/var/task:/var/task/lib:/opt/lib
  </code></pre>
  
  <p>I have created and deployed TensorFlow Lambda Layer.</p>
  
  <p>To my knowledge Lambda Layers should be cached in /opt/bin directory, right? But on documentation:<a href="https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-layers.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-layers.html</a> I see that default cache directory is <code>~/.aws-sam/layers-pkg</code>.</p>
  
  <p>Once I try to run my Lambda function with AWS SAM, and once I uncomment code which uses package in which I import tensorflow with go library, I get the following error:</p>
  
  <pre><code>error while loading shared libraries: libtensorflow.so.1: cannot open shared object file: No such file or directory
  </code></pre>
  
  <p>I have even tried to include these libraries in <strong>lib</strong> directory, and I've made that lib directory as part of <strong>LD_LIBRARY_PATH</strong>. Same result.</p>