question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Pipenv fails to install dependencies for pytest on CircleCI

See original GitHub issue

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": {}
}

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
kennethreitzcommented, Mar 11, 2018

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

0reactions
maxalbertcommented, Mar 11, 2018

Yup, it seems to be fixed in the latest version (tested with 11.4.0). Many thanks again for your support and responsiveness!

Read more comments on GitHub >

github_iconTop Results From Across the Web

CircleCI: very frustrating experience to get started
This minimal example runs pip install , correctly installing all dependencies, but fails with ModuleNotFoundError: No module named XXX .
Read more >
Can't find Python when installing dependencies
I have been running into this problem recently with all my Python project where CircleCI Linux environment can't seem to find Python.
Read more >
Python tox doesn't build anymore - Feedback & Bug Reports
The error came out of nowhere and I am unsure of how to fix it. ... run: name: install dependencies command: | pipenv...
Read more >
Python install dependencies suddenly fails
a job that I have run for a year is suddenly failing now with an inability to download my libraries/dependencies. in the past...
Read more >
Orbs - circleci/python@2.1.1
An example of running a pipenv based project with pytest. ... pkg-manager: pip - python/install-packages: pip-dependency-file: ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found