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.

Local wheel Installation failure due to path removal in Pipfile.lock

See original GitHub issue

Issue description

This issue was introduced within the PR #5464 The lines:

if not keep_outdated:
    try:
        del lockfile[category]
    except KeyError:
        pass

forces the category to be resolved latter. This strips the path key for local packages which does not get reintroduced into the lockfile later. This causes a cannot resolve package error during installation despite Pipfile.lock being created.

i.e. the Pipfile.lock for the <LOCAL_PACKAGE> loses the path.

"<LOCAL_PACKAGE>": {
    "hashes": [
        "sha256:<VALUE>"
    ],
    "path": "<PATH>"
}

becomes

"<LOCAL_PACKAGE>": {
    "hashes": [
        "sha256:<VALUE>"
    ]
}

Expected result

Pipfile.lock should maintain the path key for locally installed packages.

Actual result

[pipenv.exceptions.InstallError]: ERROR: Could not find a version that satisfies the requirement my-package (from versions: none)
[pipenv.exceptions.InstallError]: ERROR: No matching distribution found for my-package

Steps to replicate

  1. Create a Pipfile which contains a path to a local package. e.g.
[[source]]
url = "https://pypi.python.org/simple"
verify_ssl = true
name = "pypi"

[packages]
my-package = {path = "./path/to/my-package.whl"}
  1. Run pipenv install

$ pipenv --support

Pipenv version: '2022.11.30' # NOTE: Tested around 2022.11.11 and 2022.11.5 to identify.

Pipenv location: '/usr/local/lib/python3.10/site-packages/pipenv'

Python location: '/usr/local/opt/python@3.10/bin/python3.10'

OS Name: 'posix'

User pip version: '22.3'

user Python installations found:

  • 3.10.8: /usr/local/bin/python3
  • 3.9.16: /usr/local/bin/python3.9
  • 3.8.16: /usr/local/bin/python3.8

Limited output…

Issue Analytics

  • State:open
  • Created 9 months ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
matteiuscommented, Dec 17, 2022

New version has been released so you can try it from pypi install.

0reactions
matteiuscommented, Dec 17, 2022

There was a test scenario added for file but not path – we should probably add one for path as well: https://github.com/pypa/pipenv/pull/5523/files

Read more comments on GitHub >

github_iconTop Results From Across the Web

Install local wheel package missing path in lock file #5479
In my program I use a local wheel, I'm in the process to upgrading from py 3.7 to py 3.11 and I had...
Read more >
Common Pipenv Errors and How to Solve Them: Why Won't it ...
Locking Issue: Pipfile Contains a Reference to an Inexistent Package ... Pipfile won't lock when it tries to install packages that don't exist,...
Read more >
pipenv Changelog - PyUp.io
- Pipenv will now correctly unqoute special characters in wheel URIs. - Fixed a bug with parsing and grouping old-style setup.py extras during...
Read more >
pipenv Documentation - manpages.ubuntu!
The main commands are install, uninstall, and lock, which generates a Pipfile.lock. These are intended to replace $ pip install usage, as well...
Read more >
How to fix locking failed in pipenv? - Stack Overflow
Try to remove Pipefile.lock before installing a package ... Just delete the Pipfile.lock then rerun pipenv lock .
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