# Pypi deploy fails for Python 2.7

**URL:** <https://travis-ci.community/t/pypi-deploy-fails-for-python-2-7/11670>\
**Category:** Deployment\
**Tags:** python, bug, pypi\
**Created:** [June 2, 2021, 8:14am UTC](https://travis-ci.community/t/pypi-deploy-fails-for-python-2-7/11670 "2021-06-02T08:14:05Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![zhaoqin-github](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/zhaoqin-github/32/6664_2.png) [@zhaoqin-github](https://travis-ci.community/u/zhaoqin-github)\
**Post date:** [June 2, 2021, 8:14am UTC](https://travis-ci.community/t/pypi-deploy-fails-for-python-2-7/11670/1 "2021-06-02T08:14:05Z")

</div>

I have a Pypi deploy job for Python 2.7. It used to work fine, but today it fails due to get-pip.py.

My deploy code is

```
deploy:
  - provider: pypi
    user: $PYPI_USER
    password: $PYPI_PASSWORD
    on:
      all_branches: true
      tags: true
      python: 2.7
    skip_cleanup: true

```

And the error is

```
Successfully installed dpl-pypi-1.10.16

1 gem installed

2021-06-02 07:31:50 URL:https://bootstrap.pypa.io/get-pip.py [1937800/1937800] -> "-" [1]

ERROR: This script does not work on Python 2.7 The minimum supported Python version is 3.6. Please use https://bootstrap.pypa.io/pip/2.7/get-pip.py instead.

Couldn't install pip, setuptools, twine or wheel.

failed to deploy

```

Is there any way to ask Travis to download get-pip.py from Python 2.7 URL?

---

<div class="post-metadata">

**Author:** ![Montana](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/montana/32/9566_2.png) [@Montana](https://travis-ci.community/u/Montana)\
**Post date:** [June 2, 2021, 10:13am UTC](https://travis-ci.community/t/pypi-deploy-fails-for-python-2-7/11670/2 "2021-06-02T10:13:36Z")

</div>

What `dist` are you using? Try changing to `focal` via:

```auto
dist: focal

```

---

<div class="post-metadata">

**Author:** ![zhaoqin-github](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/zhaoqin-github/32/6664_2.png) [@zhaoqin-github](https://travis-ci.community/u/zhaoqin-github)\
**Post date:** [June 3, 2021, 4:48am UTC](https://travis-ci.community/t/pypi-deploy-fails-for-python-2-7/11670/3 "2021-06-03T04:48:36Z")

</div>

> [@Montana](#):
>
> `focal`

I did not specify a dist, but it still failed, after I change the dist to focal today.

My failed job link is [510627538](https://travis-ci.com/github/F5Networks/f5-common-python/jobs/510627538)

---

<div class="post-metadata">

**Author:** ![zhaoqin-github](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/zhaoqin-github/32/6664_2.png) [@zhaoqin-github](https://travis-ci.community/u/zhaoqin-github)\
**Post date:** [June 3, 2021, 5:39am UTC](https://travis-ci.community/t/pypi-deploy-fails-for-python-2-7/11670/4 "2021-06-03T05:39:12Z")

</div>

@Montana My CI job has 3 Python versions, 2.7, 3.5 and 3.6, and it only deploy Python 2.7 artifacts. 3.5 and 3.6 are only for compatibility test.

My [.travis.yml](https://github.com/F5Networks/f5-common-python/blob/v3.0.11-dev/.travis.yml)

---

<div class="post-metadata">

**Author:** ![platelminto](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/platelminto/32/7074_2.png) [@platelminto](https://travis-ci.community/u/platelminto)\
**Post date:** [September 5, 2021, 9:36pm UTC](https://travis-ci.community/t/pypi-deploy-fails-for-python-2-7/11670/6 "2021-09-05T21:36:32Z")

</div>

Did you ever get this to work? I am running into the same issue.

---

<div class="post-metadata">

**Author:** ![zhaoqin-github](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/zhaoqin-github/32/6664_2.png) [@zhaoqin-github](https://travis-ci.community/u/zhaoqin-github)\
**Post date:** [September 6, 2021, 1:38am UTC](https://travis-ci.community/t/pypi-deploy-fails-for-python-2-7/11670/7 "2021-09-06T01:38:00Z")

</div>

I use this workaround to make it work. [https://github.com/travis-ci/dpl/issues/1235](https://github.com/travis-ci/dpl/issues/1235)

My code change is [https://github.com/F5Networks/f5-common-python/pull/1590/files](https://github.com/F5Networks/f5-common-python/pull/1590/files)

---

<div class="post-metadata">

**Author:** ![platelminto](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/platelminto/32/7074_2.png) [@platelminto](https://travis-ci.community/u/platelminto)\
**Post date:** [September 6, 2021, 1:41pm UTC](https://travis-ci.community/t/pypi-deploy-fails-for-python-2-7/11670/8 "2021-09-06T13:41:47Z")

</div>

Still doesn’t work for me unfortunately, on Python 3.5. Same error as before. Meanwhile, Python 2.7 complains about having to install `python3-vevn` via `apt`, but doing so fails as it can’t find it.

I am surprised this isn’t a more common issue, as this thread and the GitHub issues are all I can find about it and neither has fixed it for me. I’m running a pretty vanilla setup I feel like.
