title: Encountered Error while trying to install package - Numpy | GCP
body: <p>I am trying to deploy a simple function as shown below:</p>
  <pre><code>import pandas as pd
  import glob
  
  def hello_gcs(event, context):
      &quot;&quot;&quot;Triggered by a change to a Cloud Storage bucket.
      Args:
           event (dict): Event payload.
           context (google.cloud.functions.Context): Metadata for the event.
      &quot;&quot;&quot;
      file = event
      print(f&quot;Processing file: {file['name']}.&quot;)
  
  
      paths = []
      all_dfs = []
      for files in glob.glob(&quot;gs://BUCKET/*/*.csv&quot;):
        paths.append(files)
      
      for i in range(len(paths)):
  
        temp_list = (paths[i].split(&quot;_&quot;))
        date_temp_list = (temp_list[2])
        read_date = (date_temp_list.split(&quot;T&quot;)[0])
  
        globals()['table%s' % i] = pd.read_csv('{}' .format(paths[i]), index_col=None, header=0) #create new dfs based on subfolder structure
        globals()['table%s' % i][&quot;Read Date&quot;] = read_date
        all_dfs.append(globals()['table%s' % i])
  
      output_df = pd.concat(all_dfs, axis=0, ignore_index=True)
      output_df.to_csv(&quot;NAME.csv&quot;)  
  </code></pre>
  <p>With my requirements txt:</p>
  <pre><code>pandas==1.0.3
  google-cloud-storage==1.26.0
  numpy==1.23.0
  </code></pre>
  <p>I am unable to deploy the function and returned with an error:</p>
  <blockquote>
  <p>Deployment failure: Build failed: ... In file included from
  /opt/python3.9/include/python3.9/unicodeobject.h:1026:0, from
  /opt/python3.9/include/python3.9/Python.h:93, from
  numpy/random/mtrand/mtrand.c:4:
  /opt/python3.9/include/python3.9/cpython/unicodeobject.h:580:45: note:
  declared here Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *)
  PyUnicode_AsUnicode( ^~~~~~~~~~~~~~~~~~~
  numpy/random/mtrand/mtrand.c:45406:25: warning:
  ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
  (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : ^ In
  file included from
  /opt/python3.9/include/python3.9/unicodeobject.h:1026:0, from
  /opt/python3.9/include/python3.9/Python.h:93, from
  numpy/random/mtrand/mtrand.c:4:
  /opt/python3.9/include/python3.9/cpython/unicodeobject.h:446:26: note:
  declared here static inline Py_ssize_t
  _PyUnicode_get_wstr_length(PyObject *op) { ^~~~~~~~~~~~~~~~~~~~~~~~~~ error: Command &quot;x86_64-linux-gnu-gcc -pthread -Wno-unused-result
  -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fstack-protector-strong -g -Wformat -Werror=format-security -fPIC -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1 -D_LARGEFILE64_SOURCE=1 -Inumpy/core/include -Ibuild/src.linux-x86_64-3.9/numpy/core/include/numpy -Inumpy/core/src/private -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/src/npysort -I/opt/python3.9/include/python3.9 -Ibuild/src.linux-x86_64-3.9/numpy/core/src/private -Ibuild/src.linux-x86_64-3.9/numpy/core/src/npymath -Ibuild/src.linux-x86_64-3.9/numpy/core/src/private -Ibuild/src.linux-x86_64-3.9/numpy/core/src/npymath -Ibuild/src.linux-x86_64-3.9/numpy/core/src/private -Ibuild/src.linux-x86_64-3.9/numpy/core/src/npymath -c numpy/random/mtrand/mtrand.c -o
  build/temp.linux-x86_64-3.9/numpy/random/mtrand/mtrand.o -MMD -MF
  build/temp.linux-x86_64-3.9/numpy/random/mtrand/mtrand.o.d&quot; failed
  with exit status 1 [end of output]</p>
  <p>note: This error originates from a subprocess, and is likely not a
  problem with pip. error: legacy-install-failure</p>
  <p>× Encountered error while trying to install package. ╰─&gt; numpy</p>
  <p>note: This is an issue with the package mentioned above, not pip.
  hint: See above for output from the failure. [end of output]</p>
  <p>note: This error originates from a subprocess, and is likely not a
  problem with pip. error: subprocess-exited-with-error</p>
  <p>× pip subprocess to install build dependencies did not run
  successfully. │ exit code: 1 ╰─&gt; See above for output.</p>
  <p>note: This error originates from a subprocess, and is likely not a
  problem with pip.; Error ID: c84b3231</p>
  </blockquote>
  <p>Now:</p>
  <ol>
  <li>In my code I am not using Numpy; I've added it to Requirements txt just to check if that would solve the error - it didn't</li>
  <li>I checked if numpy was installed at all by going to Shell and running python -m pip list; It's there</li>
  </ol>
  <p>Is there anything that I am missing here in the invokation or code part? I have no explanation for this error to happen</p>
  <p>I would appreciate any help!</p>