pipenv sync unexpected behavior when Pipfile missing

Created on 12 Apr 2018  路  6Comments  路  Source: pypa/pipenv

Pipfile:

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

[packages]
aioredis = "*"

[dev-packages]
ipython = "*"

[requires]
python_version = "3.6"

Generate Pipefile.lock for the above, delete Pipfile, and then:

$ pipenv sync
...
$ cat Pipfile.lock
{
    "_meta": {
        "hash": {
            "sha256": "4e55147db217bb4120f6e68cb8cad7bc37011457441ce0eb9d97308315625834"
        },
        "pipfile-spec": 6,
        "requires": {
            "python_version": "3.6"
        },
        "sources": [
            {
                "name": "pypi",
                "url": "https://pypi.python.org/simple",
                "verify_ssl": true
            }
        ]
    },
    "default": {},
    "develop": {}
}
Expected result

pipenv installs the packages in Pipfile.lock.

Actual result

pipenv installs no packages and replaces Pipfile.lock with a new file containing no packages.

Type good first issue

Most helpful comment

@techalchemy I think this should be reopened. When I put Pipfile.lock without the Pipfile in a Docker image and run pipenv sync in the directory with Pipfile.lock I'm getting: Error: Pipfile.lock is missing! You need to run $ pipenv lock first.. When I copy the Pipfile as well the problem disappears.

All 6 comments

I can send a PR to fix this quickly but I would like to go further into the missing features of pipenv sync, such as dry_run, dont_upgrade. It seems far from complete. Thanks

There are some bugs in here that should get sorted out, so that would be appreciated!

Closed by #1980

@techalchemy I think this should be reopened. When I put Pipfile.lock without the Pipfile in a Docker image and run pipenv sync in the directory with Pipfile.lock I'm getting: Error: Pipfile.lock is missing! You need to run $ pipenv lock first.. When I copy the Pipfile as well the problem disappears.

Just had the same issue as @butla. Took me a while to understand that the error message was incorrect. Pipfile was missing, Pipfile.lock was present, and I got
Error: Pipfile.lock is missing! You need to run $ pipenv lock first.

Sorry about that, error message seems to be pretty clearly wrong on this one!

Was this page helpful?
0 / 5 - 0 ratings