Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to lock previously locked packages #5843

Closed
edwinjosegeorge opened this issue Aug 21, 2023 · 5 comments · Fixed by #5845
Closed

Unable to lock previously locked packages #5843

edwinjosegeorge opened this issue Aug 21, 2023 · 5 comments · Fixed by #5845
Labels
Type: Bug 🐛 This issue is a bug. Type: Bugfix This issue provides a fix for a known bug.

Comments

@edwinjosegeorge
Copy link

I was tinkering around the latest pipenv version 2023.8.20 and had trouble moving from 2023.7.23. It seems this version is not backwards compatible.

Issue description

Unable to lock previously locked versions

Expected result

Lock to be completed as previous version

Actual result

Locking failed!

Traceback (most recent call last):
  File "/opt/homebrew/Cellar/pipenv/2023.8.20/libexec/lib/python3.11/site-packages/pipenv/resolver.py", line 668, in <module>
    main()
  File "/opt/homebrew/Cellar/pipenv/2023.8.20/libexec/lib/python3.11/site-packages/pipenv/resolver.py", line 654, in main
    _main(
  File "/opt/homebrew/Cellar/pipenv/2023.8.20/libexec/lib/python3.11/site-packages/pipenv/resolver.py", line 641, in _main
    resolve_packages(
  File "/opt/homebrew/Cellar/pipenv/2023.8.20/libexec/lib/python3.11/site-packages/pipenv/resolver.py", line 608, in resolve_packages
    results, resolver = resolve(
                        ^^^^^^^^
  File "/opt/homebrew/Cellar/pipenv/2023.8.20/libexec/lib/python3.11/site-packages/pipenv/resolver.py", line 588, in resolve
    return resolve_deps(
           ^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/pipenv/2023.8.20/libexec/lib/python3.11/site-packages/pipenv/utils/resolver.py", line 841, in resolve_deps
    results, hashes, internal_resolver = actually_resolve_deps(
                                         ^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/pipenv/2023.8.20/libexec/lib/python3.11/site-packages/pipenv/utils/resolver.py", line 617, in actually_resolve_deps
    results = resolver.clean_results()
              ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/pipenv/2023.8.20/libexec/lib/python3.11/site-packages/pipenv/utils/resolver.py", line 552, in clean_results
    name, entry = format_requirement_for_lockfile(
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/pipenv/2023.8.20/libexec/lib/python3.11/site-packages/pipenv/utils/locking.py", line 63, in format_requirement_for_lockfile
    entry["ref"] = determine_vcs_revision_hash(req, vcs, pipfile_entry.get("ref"))
                                                         ^^^^^^^^^^^^^^^^^
AttributeError: 'String' object has no attribute 'get'

Traceback (most recent call last):
  File "/opt/homebrew/Cellar/pipenv/2023.8.20/libexec/bin/pipenv", line 8, in <module>
    sys.exit(cli())
             ^^^^^
  File "/opt/homebrew/Cellar/pipenv/2023.8.20/libexec/lib/python3.11/site-packages/pipenv/vendor/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/pipenv/2023.8.20/libexec/lib/python3.11/site-packages/pipenv/cli/options.py", line 58, in main
    return super().main(*args, **kwargs, windows_expand_args=False)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/pipenv/2023.8.20/libexec/lib/python3.11/site-packages/pipenv/vendor/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/pipenv/2023.8.20/libexec/lib/python3.11/site-packages/pipenv/vendor/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/pipenv/2023.8.20/libexec/lib/python3.11/site-packages/pipenv/vendor/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/pipenv/2023.8.20/libexec/lib/python3.11/site-packages/pipenv/vendor/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/pipenv/2023.8.20/libexec/lib/python3.11/site-packages/pipenv/vendor/click/decorators.py", line 84, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/pipenv/2023.8.20/libexec/lib/python3.11/site-packages/pipenv/vendor/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/pipenv/2023.8.20/libexec/lib/python3.11/site-packages/pipenv/cli/command.py", line 209, in install
    do_install(
  File "/opt/homebrew/Cellar/pipenv/2023.8.20/libexec/lib/python3.11/site-packages/pipenv/routines/install.py", line 162, in do_install
    do_init(
  File "/opt/homebrew/Cellar/pipenv/2023.8.20/libexec/lib/python3.11/site-packages/pipenv/routines/install.py", line 638, in do_init
    do_lock(
  File "/opt/homebrew/Cellar/pipenv/2023.8.20/libexec/lib/python3.11/site-packages/pipenv/routines/lock.py", line 65, in do_lock
    venv_resolve_deps(
  File "/opt/homebrew/Cellar/pipenv/2023.8.20/libexec/lib/python3.11/site-packages/pipenv/utils/resolver.py", line 782, in venv_resolve_deps
    c = resolve(cmd, st, project=project)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/pipenv/2023.8.20/libexec/lib/python3.11/site-packages/pipenv/utils/resolver.py", line 651, in resolve
    raise RuntimeError("Failed to lock Pipfile.lock!")
RuntimeError: Failed to lock Pipfile.lock!

Steps to replicate

I really doubt if this information could help to debug the issue! 🙊

pipenv lock

My attempt to debug

I have the lock file which was build using 2023.7.23, now I am trying to deploy it using 2023.8.20

> pipenv --version                                
pipenv, version 2023.8.20

> pipenv install --system --dev --deploy --verbose
Courtesy Notice: Pipenv found itself running within a virtual environment, so it will automatically use that environment, instead of creating its own for any project. You can set PIPENV_IGNORE_VIRTUALENVS=1 to force pipenv to ignore that environment and create its own instead. You can set PIPENV_VERBOSITY=-1 to suppress this warning.
Installing dependencies from Pipfile.lock (548109)...
Writing supplied requirement line to temporary file: 'graphene-federation@ git+https://github.com/strollby/graphene-federation.git@6b414f1b310c0538806d25c5c25f5a312731440b'
Writing supplied requirement line to temporary file: 'retry-extended@ git+https://github.com/strollby/retry-extended@'
Writing supplied requirement line to temporary file: 'zeep@ git+https://github.com/strollby/python-zeep@'
Writing supplied requirement line to temporary file: './whl/graphene_mongo-0.4.0-py3-none-any.whl'
Install Phase: Editable Requirements
Preparing Installation of 'graphene-federation@ git+https://github.com/strollby/graphene-federation.git@6b414f1b310c0538806d25c5c25f5a312731440b'
Preparing Installation of 'retry-extended@ git+https://github.com/strollby/retry-extended@'
Preparing Installation of 'zeep@ git+https://github.com/strollby/python-zeep@'
Preparing Installation of './whl/graphene_mongo-0.4.0-py3-none-any.whl'
$ ~/my_project/.venv/bin/python3 /opt/homebrew/Cellar/pipenv/2023.8.20/libexec/lib/python3.11/site-packages/pipenv/patched/pip/__pip-runner__.py install -i 
https://pypi.org/simple --no-input --upgrade --no-deps -r /var/folders/pm/7grpkr192dq50xdn86kw8clh0000gp/T/pipenv-s58g4x67-requirements/pipenv-fddc1de8-reqs.txt
Collecting graphene-federation@ git+https://github.com/strollby/graphene-federation.git@6b414f1b310c0538806d25c5c25f5a312731440b (from -r 
/var/folders/pm/7grpkr192dq50xdn86kw8clh0000gp/T/pipenv-s58g4x67-requirements/pipenv-fddc1de8-reqs.txt (line 1))

  Using cached graphene_federation-3.1.4-py3-none-any.whl

Collecting retry-extended@ git+https://github.com/strollby/retry-extended@ (from -r /var/folders/pm/7grpkr192dq50xdn86kw8clh0000gp/T/pipenv-s58g4x67-requirements/pipenv-fddc1de8-reqs.txt (line 2))

ERROR: The URL 'git+https://github.com/strollby/retry-extended@' has an empty revision (after @) which is not supported. Include a revision after @ or remove @ from the URL.
[pipenv.exceptions.InstallError]: ERROR: The URL 'git+https://github.com/strollby/retry-extended@' has an empty revision (after @) which is not supported. Include a revision after @ or remove @ from the URL.
ERROR: Couldn't install package: {}
 Package installation failed...

checking the lock file, I found the following line

"retry-extended": {
    "git": "https://github.com/strollby/retry-extended",
},
        

Hmmm!... Then let me re-install retry-extended with version

> pipenv --version                                
pipenv, version 2023.8.20

>pipenv install "git+https://github.com/strollby/retry-extended@9b401b3dd1fce5c3e084ee130a8cc951a6d27fb9#egg=retry-extended"
[pipenv.exceptions.ResolutionFailure]: Warning: Your dependencies could not be resolved. You likely have a mismatch in your sub-dependencies.
  You can use $ pipenv run pip install <requirement_name> to bypass this mechanism, then run $ pipenv graph to inspect the versions actually installed in the virtualenv.
  Hint: try $ pipenv lock --pre if it is a pre-release dependency.
ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts

Traceback (most recent call last):
  File "~/my_project/.venv/bin/pipenv", line 8, in <module>
    sys.exit(cli())
             ^^^^^
  File "~/my_project/.venv/lib/python3.11/site-packages/pipenv/vendor/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "~/my_project/.venv/lib/python3.11/site-packages/pipenv/cli/options.py", line 58, in main
    return super().main(*args, **kwargs, windows_expand_args=False)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "~/my_project/.venv/lib/python3.11/site-packages/pipenv/vendor/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "~/my_project/.venv/lib/python3.11/site-packages/pipenv/vendor/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "~/my_project/.venv/lib/python3.11/site-packages/pipenv/vendor/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "~/my_project/.venv/lib/python3.11/site-packages/pipenv/vendor/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "~/my_project/.venv/lib/python3.11/site-packages/pipenv/vendor/click/decorators.py", line 84, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "~/my_project/.venv/lib/python3.11/site-packages/pipenv/vendor/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "~/my_project/.venv/lib/python3.11/site-packages/pipenv/cli/command.py", line 209, in install
    do_install(
  File "~/my_project/.venv/lib/python3.11/site-packages/pipenv/routines/install.py", line 292, in do_install
    raise e
  File "~/my_project/.venv/lib/python3.11/site-packages/pipenv/routines/install.py", line 277, in do_install
    do_init(
  File "~/my_project/.venv/lib/python3.11/site-packages/pipenv/routines/install.py", line 614, in do_init
    do_lock(
  File "~/my_project/.venv/lib/python3.11/site-packages/pipenv/routines/lock.py", line 65, in do_lock
    venv_resolve_deps(
  File "~/my_project/.venv/lib/python3.11/site-packages/pipenv/utils/resolver.py", line 782, in venv_resolve_deps
    c = resolve(cmd, st, project=project)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "~/my_project/.venv/lib/python3.11/site-packages/pipenv/utils/resolver.py", line 651, in resolve
    raise RuntimeError("Failed to lock Pipfile.lock!")
RuntimeError: Failed to lock Pipfile.lock!

Ugh! Let's retry with old pipenv version

> pipenv --version                                
pipenv, version 2023.7.23

>pipenv install "git+https://github.com/strollby/retry-extended@9b401b3dd1fce5c3e084ee130a8cc951a6d27fb9#egg=retry-extended"

Success!!.... Heh! So the lock was actually possible!!

Now the lock file is updated as follows

"retry-extended": {
    "git": "https://github.com/strollby/retry-extended",
    "ref": "9b401b3dd1fce5c3e084ee130a8cc951a6d27fb9"
},

OK. It seems the issue might have resolved. Let me deploy using the new pipenv

> pipenv --version                                
pipenv, version 2023.8.20

> pipenv install --system --dev --deploy --verbose
Courtesy Notice: Pipenv found itself running within a virtual environment, so it will automatically use that environment, instead of creating its own for any project. You can set PIPENV_IGNORE_VIRTUALENVS=1 to force pipenv to ignore that environment and create its own instead. You can set PIPENV_VERBOSITY=-1 to suppress this warning.
Installing dependencies from Pipfile.lock (d23d84)...
Writing supplied requirement line to temporary file: 'graphene-federation@ git+https://github.com/strollby/graphene-federation.git@6b414f1b310c0538806d25c5c25f5a312731440b'
Writing supplied requirement line to temporary file: 'retry-extended@ git+https://github.com/strollby/retry-extended@9b401b3dd1fce5c3e084ee130a8cc951a6d27fb9'
Writing supplied requirement line to temporary file: 'zeep@ git+https://github.com/strollby/python-zeep@'
Writing supplied requirement line to temporary file: './whl/graphene_mongo-0.4.0-py3-none-any.whl'
Install Phase: Editable Requirements
Preparing Installation of 'graphene-federation@ git+https://github.com/strollby/graphene-federation.git@6b414f1b310c0538806d25c5c25f5a312731440b'
Preparing Installation of 'retry-extended@ git+https://github.com/strollby/retry-extended@9b401b3dd1fce5c3e084ee130a8cc951a6d27fb9'
Preparing Installation of 'zeep@ git+https://github.com/strollby/python-zeep@'
Preparing Installation of './whl/graphene_mongo-0.4.0-py3-none-any.whl'
$ ~/my_project/.venv/bin/python3 ~/my_project/.venv/lib/python3.11/site-packages/pipenv/patched/pip/__pip-runner__.py install -i 
https://pypi.org/simple --no-input --upgrade --no-deps -r /var/folders/pm/7grpkr192dq50xdn86kw8clh0000gp/T/pipenv-3cmyz2j2-requirements/pipenv-rph25xmu-reqs.txt
Collecting graphene-federation@ git+https://github.com/strollby/graphene-federation.git@6b414f1b310c0538806d25c5c25f5a312731440b (from -r 
/var/folders/pm/7grpkr192dq50xdn86kw8clh0000gp/T/pipenv-3cmyz2j2-requirements/pipenv-rph25xmu-reqs.txt (line 1))

  Using cached graphene_federation-3.1.4-py3-none-any.whl

Collecting retry-extended@ git+https://github.com/strollby/retry-extended@9b401b3dd1fce5c3e084ee130a8cc951a6d27fb9 (from -r 
/var/folders/pm/7grpkr192dq50xdn86kw8clh0000gp/T/pipenv-3cmyz2j2-requirements/pipenv-rph25xmu-reqs.txt (line 2))

  Using cached retry_extended-0.2.3-py3-none-any.whl

Collecting zeep@ git+https://github.com/strollby/python-zeep@ (from -r /var/folders/pm/7grpkr192dq50xdn86kw8clh0000gp/T/pipenv-3cmyz2j2-requirements/pipenv-rph25xmu-reqs.txt (line 3))

ERROR: The URL 'git+https://github.com/strollby/python-zeep@' has an empty revision (after @) which is not supported. Include a revision after @ or remove @ from the URL.
[pipenv.exceptions.InstallError]: ERROR: The URL 'git+https://github.com/strollby/python-zeep@' has an empty revision (after @) which is not supported. Include a revision after @ or remove @ from the URL.
ERROR: Couldn't install package: {}
 Package installation failed...

Ops!. Should I do the same with python-zeep ??? but this dependency is from one of my private library

What is happening here? Any help?

@matteius
Copy link
Member

What is including python-zeep without a revision? That part is likely a bug that we need to be able to handle no revision specified. As for the Pipfile entry that is a vcs dependency without being a dictionary (just a string) ... I didn't know this was ever supported. I guess pipenv knew it was vcs and the type because of the git+ before, but this is surprising as it was also possible in the dictionary form to leave off the git+ part and infer it from the key of the dictionary.

I do apologize for this issue you are experiencing, it is definitely caused by the refactor to move away from requirementslib in order to fix issues with file and remote installs with extras and other edge cases. We will work towards a patch of this in the coming week.

Just to recap, I think the first thing to fix is supporting a Pipfile entry without a revision, and then to explore the case of a vcs Pipfile entry being just a string.

@edwinjosegeorge
Copy link
Author

Hi, I did checked out your fix and it worked smoothly!🤩

@matteius matteius added Type: Bugfix This issue provides a fix for a known bug. Type: Bug 🐛 This issue is a bug. labels Aug 22, 2023
@matteius
Copy link
Member

Just cut release 2023.8.21 with the proposed fix.

@edwinjosegeorge
Copy link
Author

Hey @matteius, I managed to reproduce the error again...🙂 Here is what happened...

Now I am playing with pipenv==2028.8.23 and i have a set of packages installed along with the lock. I just added couple of print statements in the file https://github.com/pypa/pipenv/blob/main/pipenv/utils/locking.py as follows to see whats happening inside...

def format_requirement_for_lockfile(
    req: InstallRequirement,
    markers_lookup,
    index_lookup,
    original_deps,
    pipfile_entries,
    hashes=None,
):
    if req.specifier:
        version = str(req.specifier)
    else:
        version = None
    name = normalize_name(req.name)
    index = index_lookup.get(name)
    markers = req.markers
    req.index = index
    pipfile_entry = pipfile_entries[name] if name in pipfile_entries else {}

print(f"WATCHING {name=} {pipfile_entry=}")

    entry = {}
    if req.link and req.link.is_vcs:
        vcs = req.link.scheme.split("+", 1)[0]

print(f"TRYING {req= } {vcs=} {pipfile_entry=}")

        entry["ref"] = determine_vcs_revision_hash(req, vcs, pipfile_entry.get("ref"))
        if name in original_deps:
            entry[vcs] = original_deps[name]
        else:
            entry[vcs] = req.link.url
...

Also I have the following entry in piplock from the previous installs

"retry-extended": {
            "hashes": [
                "sha256:3cfe52a3a7db434803ca32ea0af40f93c3e77c4e93a83121a7aca0155ba0f669",
                "sha256:a797e897759b5d26af1ee8d1255a1197b69e741bdc7bfcc6b40ff1096c7a28bc"
            ],
            "index": "pypi",
            "markers": "python_version >= '3.7' and python_version < '4.0'",
            "version": "==0.2.3"
        },

and my pipfile have the following entry in packages
retry-extended=="*"

Now I am trying to install one of my private library

>pipenv install --index "private" my_private_lib
Installing my_private_lib...
Resolving my_private_lib...
Added my_private_lib to Pipfile's [packages] ...
✔ Installation Succeeded
Pipfile.lock (df6deb) out of date, updating to (b62dac)...
Locking [packages] dependencies...
Building requirements...
Resolving dependencies...
...
...
WATCHING name='retry-extended' pipfile_entry='*'
TRYING req= <InstallRequirement object: retry-extended@ git+https://github.com/strollby/retry-extended ; python_version >= "3.7" and python_version < "4.0" from git+https://github.com/strollby/retry-extended (from my_private_lib==0.3.19->-r /var/folders/pm/7grpkr192dq50xdn86kw8clh0000gp/T/pipenv-8bkys8uj-requirements/pipenv-z4wowm7d-constraints.txt (line 13)) editable=False> vcs='git' pipfile_entry='*'
Traceback (most recent call last):
  File "/opt/homebrew/Cellar/pipenv/2023.8.23/libexec/bin/pipenv", line 8, in <module>
    sys.exit(cli())
             ^^^^^
  File "/opt/homebrew/Cellar/pipenv/2023.8.23/libexec/lib/python3.11/site-packages/pipenv/vendor/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/pipenv/2023.8.23/libexec/lib/python3.11/site-packages/pipenv/cli/options.py", line 58, in main
    return super().main(*args, **kwargs, windows_expand_args=False)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/pipenv/2023.8.23/libexec/lib/python3.11/site-packages/pipenv/vendor/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/pipenv/2023.8.23/libexec/lib/python3.11/site-packages/pipenv/vendor/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/pipenv/2023.8.23/libexec/lib/python3.11/site-packages/pipenv/vendor/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/pipenv/2023.8.23/libexec/lib/python3.11/site-packages/pipenv/vendor/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/pipenv/2023.8.23/libexec/lib/python3.11/site-packages/pipenv/vendor/click/decorators.py", line 84, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/pipenv/2023.8.23/libexec/lib/python3.11/site-packages/pipenv/vendor/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/pipenv/2023.8.23/libexec/lib/python3.11/site-packages/pipenv/cli/command.py", line 209, in install
    do_install(
  File "/opt/homebrew/Cellar/pipenv/2023.8.23/libexec/lib/python3.11/site-packages/pipenv/routines/install.py", line 297, in do_install
    raise e
  File "/opt/homebrew/Cellar/pipenv/2023.8.23/libexec/lib/python3.11/site-packages/pipenv/routines/install.py", line 281, in do_install
    do_init(
  File "/opt/homebrew/Cellar/pipenv/2023.8.23/libexec/lib/python3.11/site-packages/pipenv/routines/install.py", line 648, in do_init
    do_lock(
  File "/opt/homebrew/Cellar/pipenv/2023.8.23/libexec/lib/python3.11/site-packages/pipenv/routines/lock.py", line 65, in do_lock
    venv_resolve_deps(
  File "/opt/homebrew/Cellar/pipenv/2023.8.23/libexec/lib/python3.11/site-packages/pipenv/utils/resolver.py", line 789, in venv_resolve_deps
    c = resolve(cmd, st, project=project)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/pipenv/2023.8.23/libexec/lib/python3.11/site-packages/pipenv/utils/resolver.py", line 658, in resolve
    raise RuntimeError("Failed to lock Pipfile.lock!")
RuntimeError: Failed to lock Pipfile.lock!

If it helps, my private library was build using poetry with the following entry in .toml file

...
[tool.poetry.dependencies]
python = "^3.9"
retry-extended = { git = "https://github.com/strollby/retry-extended" }
...

@TiansuYu
Copy link

TiansuYu commented Aug 1, 2024

This happens with our team 50% of the time running pipenv lock. Something goes really wrong with the dependency resolution at Pipenv here...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug 🐛 This issue is a bug. Type: Bugfix This issue provides a fix for a known bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants