Pipenv missing PIPENV_PYPI_MIRROR

#1

Circle is driving me crazy. My branch passed tests fine. After merging I get an error about missing PIPENV_PYPI_MIRROR?

#!/bin/bash -eo pipefail
sudo pip install pipenv
pipenv install -d
Requirement already satisfied: pipenv in /usr/local/lib/python3.6/site-packages
Requirement already satisfied: virtualenv in /usr/local/lib/python3.6/site-packages (from pipenv)
Requirement already satisfied: certifi in /usr/local/lib/python3.6/site-packages (from pipenv)
Requirement already satisfied: setuptools>=36.2.1 in /usr/local/lib/python3.6/site-packages (from pipenv)
Requirement already satisfied: virtualenv-clone>=0.2.5 in /usr/local/lib/python3.6/site-packages (from pipenv)
Requirement already satisfied: pip>=9.0.1 in /usr/local/lib/python3.6/site-packages (from pipenv)
You are using pip version 19.1, however version 19.1.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Traceback (most recent call last):
  File "/usr/local/bin/pipenv", line 7, in <module>
    from pipenv import cli
  File "/usr/local/lib/python3.6/site-packages/pipenv/__init__.py", line 21, in <module>
    from .cli import cli
  File "/usr/local/lib/python3.6/site-packages/pipenv/cli/__init__.py", line 3, in <module>
    from .command import cli
  File "/usr/local/lib/python3.6/site-packages/pipenv/cli/command.py", line 79, in <module>
    clear=False,
  File "/usr/local/lib/python3.6/site-packages/pipenv/cli/options.py", line 386, in general_options
    f = common_options(f)
  File "/usr/local/lib/python3.6/site-packages/pipenv/cli/options.py", line 336, in common_options
    f = pypi_mirror_option(f)
  File "/usr/local/lib/python3.6/site-packages/pipenv/cli/options.py", line 224, in pypi_mirror_option
    return option("--pypi-mirror", default=environments.PIPENV_PYPI_MIRROR, nargs=1,
AttributeError: module 'pipenv.environments' has no attribute 'PIPENV_PYPI_MIRROR'
Exited with code 1
#2

In comparing to a previous build that passed, I see that somehow it is not using the Pipfile.lock.

This passed:

sudo pip install pipenv
pipenv install -d
Requirement already satisfied: pipenv in /usr/local/lib/python3.6/site-packages (2018.11.26)
Requirement already satisfied: virtualenv in /usr/local/lib/python3.6/site-packages (from pipenv) (16.5.0)
Requirement already satisfied: certifi in /usr/local/lib/python3.6/site-packages (from pipenv) (2019.3.9)
Requirement already satisfied: virtualenv-clone>=0.2.5 in /usr/local/lib/python3.6/site-packages (from pipenv) (0.5.3)
Requirement already satisfied: setuptools>=36.2.1 in /usr/local/lib/python3.6/site-packages (from pipenv) (41.0.1)
Requirement already satisfied: pip>=9.0.1 in /usr/local/lib/python3.6/site-packages (from pipenv) (19.1)
Installing dependencies from Pipfile.lock (ee50ce)…
Ignoring appnope: markers 'sys_platform == "darwin"' don't match your environment
Looking in indexes: https://pypi.python.org/simple
     ================================ 86/86 — 00:00:07

But the “Installing dependencies from Pipfile.lock” is missing in the failed compilation.

So now the question is, how do I ensure it uses Pipfile.lock? Why would it run differently these two times?