0

I have a package containing some helper functions in a repository in Artifact Registry on GCP in project a. I prepped the package by following this guide, only changing the name of the package from quickstart to my own custom name and then pushing my custom code rather than their samples. When I follow the steps to see the package name and version I get the expected results, that of version 0.0.1 and the package name of data-analysis-toolbox.

There are cloud functions in project b that require this package. I am able to deploy the cloud functions successfully as I have added a role to the cloud build SA along with giving it access to the Artifact Registry following this answer.

I then added the --extra-index-url line to the requirements.txt file and was able to deploy the function. However, when actually running the function I get an error stating

ModuleNotFoundError: No module named 'data_analysis_toolbox'

where 'data_analysis_toolbox' is the name of the package from my Artifact Registry.

This occurs whether I do the import as

from data-analysis-toolbox import <file>

or even with a simple

import data-analysis-toolbox

Any thoughts on what may be occurring here?

Ryan
  • 97
  • 1
  • 12
  • This guide will help you configure Artifact Registry with Python Pip. https://cloud.google.com/artifact-registry/docs/python/store-python Edit your question with details on what you configured. – John Hanley May 26 '22 at 19:42
  • This is the guide I followed. The only thing I did differently was name the package with my custom package and push that code rather than their samples. – Ryan May 26 '22 at 19:43
  • Your question does not have those details on what you configured, so we cannot determine what you might have done wrong or skipped. We can only guess and make suggestions. – John Hanley May 26 '22 at 19:46
  • Updated the question as well. – Ryan May 26 '22 at 19:58
  • 1
    You can reference a guide that you followed. However, links change, content is modified, links are deleted, etc which might render your question useless in the future. Your question must be **self-contained**. I have no idea if you followed the guide correctly. If you want help, create a question with all required details. I cannot reproduce your problem based on your question. This guide might help: https://stackoverflow.com/help/minimal-reproducible-example – John Hanley May 26 '22 at 22:16

0 Answers0