# Build errors installing a common dependency (docopt) on python 3.7 but not other versions

**URL:** <https://travis-ci.community/t/build-errors-installing-a-common-dependency-docopt-on-python-3-7-but-not-other-versions/12886>\
**Category:** Python\
**Created:** [April 13, 2022, 6:02pm UTC](https://travis-ci.community/t/build-errors-installing-a-common-dependency-docopt-on-python-3-7-but-not-other-versions/12886 "2022-04-13T18:02:38Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![bkuczenski](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/bkuczenski/32/6757_2.png) [@bkuczenski](https://travis-ci.community/u/bkuczenski)\
**Post date:** [April 13, 2022, 6:02pm UTC](https://travis-ci.community/t/build-errors-installing-a-common-dependency-docopt-on-python-3-7-but-not-other-versions/12886/1 "2022-04-13T18:02:38Z")

</div>

Hi folks,  
I am using `coveralls.io` track my test coverage and my build configuration includes the line:

```
$ pip install coverage coveralls

```

This worked normally in the past because it is an unremarkable requirement. Here is a link to a successful build:

> **[Travis CI - Test and Deploy with Confidence](https://app.travis-ci.com/github/AntelopeLCA/core/builds/245229404)**
>
> Travis CI enables your team to test and ship your apps with confidence. Easily sync your projects with Travis CI and you'll be testing your code in minutes.

I haven’t worked on this project for 3 months. However, as of this week, the same command generates an error when installing `docopt` (0.6.2), a sub-dependendcy of `coveralls`. Here is a link to a broken build:

> **[Travis CI - Test and Deploy with Confidence](https://app.travis-ci.com/github/AntelopeLCA/core/jobs/566480154)**
>
> Travis CI enables your team to test and ship your apps with confidence. Easily sync your projects with Travis CI and you'll be testing your code in minutes.

The test that fails is in python 3.7. `docopt` 0.6.2 was last updated in 2014. Even though the project only [lists compatibility](https://pypi.org/project/docopt/) through python 3.3, the same configuration does not create errors in python 3.8 or 3.9: [Travis CI - Test and Deploy with Confidence](https://app.travis-ci.com/github/AntelopeLCA/core/builds/249161133)  
And, like I said, it worked fine in python 3.7 until recently.

None of the versions of the packages have changed. I don’t have any trouble installing docopt locally so I can’t understand where this problem came from. My travis configuration is super simple: [core/.travis.yml at master · AntelopeLCA/core · GitHub](https://github.com/AntelopeLCA/core/blob/master/.travis.yml)

Any hints as to what is going on? Thanks in advance.

---

<div class="post-metadata">

**Author:** ![mustafa](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/mustafa/32/2752_2.png) [@mustafa](https://travis-ci.community/u/mustafa)\
**Post date:** [April 18, 2022, 9:40am UTC](https://travis-ci.community/t/build-errors-installing-a-common-dependency-docopt-on-python-3-7-but-not-other-versions/12886/2 "2022-04-18T09:40:07Z")

</div>

Hey there,

It seems like there are many version differences between those builds. I have run a diff check [between them (left is failing - right is succeeding), you can see that you have pip version difference that you can recover installation the version `22.0.4` as it was in the last succeeding build.

I hope this would be helpful.

[1] [Untitled Diff - Diff Checker](https://www.diffchecker.com/isxKpU1F)

---

<div class="post-metadata">

**Author:** ![bkuczenski](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/bkuczenski/32/6757_2.png) [@bkuczenski](https://travis-ci.community/u/bkuczenski)\
**Post date:** [April 18, 2022, 6:20pm UTC](https://travis-ci.community/t/build-errors-installing-a-common-dependency-docopt-on-python-3-7-but-not-other-versions/12886/3 "2022-04-18T18:20:59Z")

</div>

Thanks for your reply- I see what you mean, the failing build is using a newer version of pip (22.0.4) and the last successful build used version 20.1. But I don’t install/specify pip, it comes with the container. I didn’t change the container so why would the version of pip change?

Anyway, I am running pip 22.0.4 on my physical machine at home and it installs just fine there, so I am skeptical that that would explain the difference. If you can suggest how to tell travis to install an old version of pip, then I could investigate that.

---

<div class="post-metadata">

**Author:** ![mustafa](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/mustafa/32/2752_2.png) [@mustafa](https://travis-ci.community/u/mustafa)\
**Post date:** [April 19, 2022, 1:29pm UTC](https://travis-ci.community/t/build-errors-installing-a-common-dependency-docopt-on-python-3-7-but-not-other-versions/12886/4 "2022-04-19T13:29:16Z")

</div>

Hey,

This should help to downgrade the version of the current pip:

`pip install pip==22.0.4`

Thanks

---

<div class="post-metadata">

**Author:** ![bkuczenski](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/bkuczenski/32/6757_2.png) [@bkuczenski](https://travis-ci.community/u/bkuczenski)\
**Post date:** [April 20, 2022, 8:44am UTC](https://travis-ci.community/t/build-errors-installing-a-common-dependency-docopt-on-python-3-7-but-not-other-versions/12886/5 "2022-04-20T08:44:53Z")

</div>

That was a helpful suggestion. I adjusted my travis.yml file to conditionally downgrade pip to the last working version (20.1):

```auto
before_install:
 - if [[$TRAVIS_PYTHON_VERSION == 3.7]]; then pip install pip==20.1; fi

```

This runs correctly but the job still fails with the same error. It appears to have something to do with the `importlib_metadata` package-- I tried pip install -U importlib\_metadata and that solved it! see: [Travis CI - Test and Deploy with Confidence](https://app.travis-ci.com/github/AntelopeLCA/core/jobs/567610590)

```auto
before_install:
 - if [[$TRAVIS_PYTHON_VERSION == 3.7]]; then pip install -U importlib_metadata; fi

```
