pipenv: Pipenv fails to install dependencies for pytest on CircleCI

I ran into this issue on CircleCI in a private repo which runs tests using pytest, and where pytest and the other dependencies are installed using pipenv.

Until recently this worked fine and the CircleCI build passed. However, after a push to this repo today the CirlcleCI build now fails to install the dependencies for pytest - when trying to run pytest it complains about the missing module six.

Strangely, I can’t reproduce this issue on a local machine, but it definitely fails on CircleCI (see link to minimal repo reproducing the error below). I’m not sure if it’s specific to CircleCI or simply due to some differences in the setup.

Describe your environment

Here is the CirleCI build environment:

  1. OS Type: Debian GNU/Linux 8
  2. Python version: 3.6.4
  3. Pipenv version: 11.1.11
Expected result
$ pipenv run pytest --version
This is pytest version 3.4.2, imported from /home/circleci/.local/share/virtualenvs/project-zxI9dQ-Q/lib/python3.6/site-packages/pytest.py
Actual result
$ pipenv run pytest --version
Traceback (most recent call last):
  File "/home/circleci/.local/share/virtualenvs/project-zxI9dQ-Q/bin/pytest", line 7, in <module>
    from pytest import main
  File "/home/circleci/.local/share/virtualenvs/project-zxI9dQ-Q/lib/python3.6/site-packages/pytest.py", line 9, in <module>
    from _pytest.config import (
  File "/home/circleci/.local/share/virtualenvs/project-zxI9dQ-Q/lib/python3.6/site-packages/_pytest/config.py", line 9, in <module>
    import six
ModuleNotFoundError: No module named 'six'
Steps to replicate

Here is a minimal repo which reproduces the failure. The output of a failing CircleCI test run can be seen here.

The CircleCI config file in this repo runs the following steps:

  • Install pipenv and virtualenv
  • Run pipenv install, which should install pytest and its dependencies
  • Run pytest --version to verify that pytest was installed correctly and can be run (this is the step that fails)

This is the Pipfile used:

[[source]]

url = "https://pypi.python.org/simple"
verify_ssl = true
name = "pypi"


[packages]

pytest = "==3.4.2"


[requires]

python_version = "3.6"

And here is the Pipfile.lock which is generated by pipenv install:

{
    "_meta": {
        "hash": {
            "sha256": "748122aab9868a7d99e975aaf09590e4f055778cb44e01aa11039d8d9bc2d2bf"
        },
        "pipfile-spec": 6,
        "requires": {
            "python_version": "3.6"
        },
        "sources": [
            {
                "name": "pypi",
                "url": "https://pypi.python.org/simple",
                "verify_ssl": true
            }
        ]
    },
    "default": {
        "pytest": {
            "hashes": [
                "sha256:062027955bccbc04d2fcd5d79690947e018ba31abe4c90b2c6721abec734261b",
                "sha256:117bad36c1a787e1a8a659df35de53ba05f9f3398fb9e4ac17e80ad5903eb8c5"
            ],
            "version": "==3.4.2"
        }
    },
    "develop": {}
}

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 32 (15 by maintainers)

Most upvoted comments

Very sorry for the bugs. We got our shit together now 😃