Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Pipeline fail to publish to pypi when package contains dependencies


I'm trying to publish a python package but build fails on pipe


My package requires requests and pytz so, on I have install_requires=['requests', 'pytz']


The atlassian/pypi-publish:0.3.1 image can't find pytz module so, how I can handle this?


1 answer

0 votes


follow Python Packaging guide

and use appropriate DISTRIBUTIONS.


'DISTRIBUTIONS': 'sdist bdist_wheel'
This should help you.
You also may want some of the next commands to put in DISTRIBUTIONS variable instead of that, depending on your case (generally you need either  bdist_wheel distributions or just execute the command Before publishing : `python install`, e.g.).
You can find more commands cli man , typing
`python --help-commands`
Regards, Galyna

Hey @Halyna Berezovska thanks for the reply but it will not help.

I already following this exactly Python Package guide and have the DISTRIBUTION set on my bitbucket-pipelines.yml. Using a python venv without pytz, the behavior is the same when I ran "python " ModuleNotFoundError: No module named 'pytz'

Since pytz and requests are needed, I need to install it on pypi-publish before run.


try to run

python install


python develop

instead, before using the pipe publishing. This should install needed things.

I have tested this with pytz also and with other packages and this works for our repository also where we publish package with dependencies.


deploy: &deploy
name: Deploy to PyPI
- python install
- pipe: atlassian/pypi-publish:0.2.3


@diego.magalhaes  if doesn't , please share full logs, we'll try to investigate

@Halyna Berezovska 

I found a way to solve this problem before your reply. The pipe was removed from yaml and I used twine to upload and it directly so:

- pip install twine requests pytz
- python sdist bdist_wheel
- twine check dist/*
- twine upload -u ${PYPI_USERNAME} -p ${PYPI_PASSWORD} dist/*

 Thank's for your support!

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Bitbucket

⭐ Calling all Bitbucket and DevOps experts: Special showcase opportunity ⭐

Hi, Bitbucket community! Are you a DevOps practitioner (or know one in your network)? Do you have DevOps tips, tricks, or learnings you'd like to share with the community? If so, we'd love to hea...

1,497 views 4 8
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you