pipjupyter-notebookgoogle-cloud-source-reposkubeflow

Pip install from private Google Source Repo


How do you pip install from a private repo via Google Cloud Source repos? Seems like something that should be possible.

!pip install gcloud source repos clone [REPOSITORY_NAME] --project=[PROJECT_NAME]

Solution

  • I haven't used Cloud Source Repositories (so I haven't tested this), but it seems like you would need to do one of two things:

    1. pip install from the repo's URL, if it has a public URL. For example, something like the following:
    !pip install https://source.developers.google.com/p/[PROJECT_ID]/r/[REPO_NAME]
    
    1. pip install from a local clone of your repository. For example:
    gcloud source repos clone [REPOSITORY_NAME] --project=[PROJECT_NAME] 
    !pip install -e [PATH_TO_CLONED_REPO]