How should we install internal python packages while running bitbucket pipeline?

Nikita Gupta August 17, 2017

We have packages from our internal pip server that are used in the repository. How to install these packages while running the bitbucket pipeline.

Please find the attached screenshot of the error shown. Screen Shot 2017-08-17 at 7.57.44 PM.png

1 answer

0 votes
Philip Hodder
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 28, 2017

Hello,

 

Is your internal pip server somehow accessible via the public internet?

Here's how you can add a private git repository as a dependency. Maybe this can get your started on the right track? https://stackoverflow.com/questions/4830856/is-it-possible-to-use-pip-to-install-a-package-from-a-private-github-repository

Thanks,

Phil

stevemapes July 27, 2020

@Philip Hodder  - I know this is an old question but I've just hit this issue myself where I have a private pypi server with built packages from a git repo stored in Bitbucket that I need to use in the pipelines of another repository. The Pypi server is IP and username restricted and I don't want to make it public so I was wondering if there is another way to load private packages in directly into the caches or even by using the git+ version though since it's a private bit bucket repo as well will that even work or does pipeline run as the user making the commit?

Like Diego Fioravanti likes this
stevemapes August 5, 2020

So the answer was

  1. In the project you are working on go to Settings -> Pipelines -> SSH Keys and generate a new key
  2. Go to the repository of the package you wish to install and under the main Access Keys paste the key that you just created.
  3. In the YML file use pip install git+ssh://git@bitbucket.org/owner/repos.git
Like # people like this
Mark Ramakers November 24, 2020

I like the answer, apart from the fact that I now have to change the git user locally whenever installing dependencies. How would I set it up so it works locally as well?

stevemapes November 25, 2020

Why do you have to change the local git user you shouldn't need to as you're adding a new SSH key to use projects on Bitbucket directly to the project not to a user?

You can still clone locally and use your own SSH key to authenticate as I'm doing exactly that.

Like Cord Slatton likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events