Details :
I want to upload and download python wheel files to bitbucket's repo download section.
I want it should be done either way meaning from bit bucket web interface as well as using the APIs or commands (with necessary credential)
Key points
I am able to upload / download using bit bucket web interface.
i have added app password
I am able to upload using POST method (using my username , app password)
I was trying to install that wheel package using pip command as below
pip install --user --extra-index-url https://myusername:mypass@bitbucket.org/owner-username/repo-slug/downloads/my_package-0.1.0-py3-none-any.whl
Bit getting below error
ERROR: You must give at least one requirement to install (see "pip help install")
I also tried with the get request it says
HTTP request sent, awaiting response... 401 Unauthorized
So my question is i don't have download access using the API/pip as able to able so it shoule be there
My app password having repository read and write permission.
Please sugget what could be the solution . Thanks
Hi Appu and welcome to the community!
The Downloads section of a Bitbucket repository is not a package registry, so I'm not sure if it's possible to to download a file from there with the pip install command.
You can download the file using our API, but the credentials need to be provided separately and not as part of the URL. An example of such an API call with curl is the following:
curl -s -L -O -u username:app_password https://api.bitbucket.org/2.0/repositories/workspace-id/repo-slug/downloads/my_package-0.1.0-py3-none-any.whl
where username, app_password, workspace-id and repo-slug replace with your own values. Also, replace my_package-0.1.0-py3-none-any.whl if the name of your package is different.
Reference:
Does this work for you?
Kind regards,
Theodora
Hey Theodora,
Thanks a lot. It did work for me.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You are very welcome, Appu! Please feel free to reach out if you ever need anything else!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.