Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

pip install failed when try to install wheel file form download section using URL with creadentials

Appu Singh
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 18, 2024

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

1 answer

1 accepted

0 votes
Answer accepted
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 20, 2024

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

Appu Singh
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 27, 2024

Hey Theodora, 

 

Thanks a lot. It did work for me. 

Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 27, 2024

You are very welcome, Appu! Please feel free to reach out if you ever need anything else!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events