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 extras from `Pipfile.lock`

See original GitHub issue

Issue description

Pipenv fails to install extras for a dependency if using Pipfile.lock. This would appear to be related to #1094.

Expected result

Pipenv should install extras regardless of whether Pipefile or Pipfile.lock is used, given the two are in sync. However, pip freeze shows none of the packages required by the desired extra as installed. However, --verbose output shows that installation is occurring:

Actual result

Pipenv only installs extras when installing from Pipfile.

Steps to replicate

Pipfile (sanitized):

foo = {extras = ["gps"], git = "git@private.git.server.com/foo.git", ref = "some-ref"}

When I install in my development environment via pipenv update, the extra is installed. My Pipfile.lock contains:

"foo": {
	"extras": [
		"gps"
	],
	"git": "git@private.git.server.com/foo.git",
	"ref": "XXXXXXX"
},

When installing for production via:

$ pipenv install --deploy --system --verbose

The extra is not installed. And I see the following output:

#15 15.27 Collecting foo[gps]
#15 15.27   Cloning ssh://****@private.git.server.com/foo.git (to revision XXXXXXXX) to /tmp/pip-install-j6hv06g5/foo
#15 15.27   Added foo[gps] from git+ssh://****@private.git.server.com/foo.git@XXXXXXX#egg=foo[gps] (from -r /tmp/pipenv-_vqdslph-requirements/pipenv-ey5b5tem-requirement.txt (line 1)) to build tracker '/tmp/pip-req-tracker-td0jikde'
#15 15.27     Running setup.py (path:/tmp/pip-install-j6hv06g5/foo/setup.py) egg_info for package foo
#15 15.27     Created temporary directory: /tmp/pip-pip-egg-info-8ta1ltk_
#15 15.27   Source in /tmp/pip-install-j6hv06g5/foo has version 0.6.0, which satisfies requirement foo[gps] from git+ssh://****@private.git.server.com/foo.git@XXXXXXXX#egg=foo[gps] (from -r /tmp/pipenv-_vqdslph-requirements/pipenv-ey5b5tem-requirement.txt (line 1))
#15 15.27   Removed foo[gps] from git+ssh://****@private.git.server.com/foo.git@XXXXXXXX#egg=foo[gps] (from -r /tmp/pipenv-_vqdslph-requirements/pipenv-ey5b5tem-requirement.txt (line 1)) from build tracker '/tmp/pip-req-tracker-td0jikde'

If I instead install via:

$ pipenv install --deploy --system --skip-lock --verbose

Then the extra is installed and I see output similar to that above but with an additional line at the end:

#15 31.30   Installing extra requirements: 'gps'

$ pipenv --support

Pipenv version: '2020.6.2'

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

Python location: '/usr/local/opt/python@3.8/bin/python3.8'

Python installations found:

  • 3.8.1: /usr/local/opt/python@3.8/bin/python3
  • 3.8.1: /usr/local/opt/python@3.8/bin/python3.8
  • 3.7.6: /usr/local/bin/python3
  • 3.7.6: /usr/local/bin/python3.7m
  • 3.7.6: /usr/local/bin/python3.7
  • 2.7.10: /usr/bin/python2.7

PEP 508 Information:

{'implementation_name': 'cpython',
 'implementation_version': '3.8.1',
 'os_name': 'posix',
 'platform_machine': 'x86_64',
 'platform_python_implementation': 'CPython',
 'platform_release': '18.2.0',
 'platform_system': 'Darwin',
 'platform_version': 'Darwin Kernel Version 18.2.0: Fri Oct  5 19:41:49 PDT '
                     '2018; root:xnu-4903.221.2~2/RELEASE_X86_64',
 'python_full_version': '3.8.1',
 'python_version': '3.8',
 'sys_platform': 'darwin'}

System environment variables:

  • USER
  • TERMINAL_EMULATOR
  • HOME
  • COMMAND_MODE
  • LOGIN_SHELL
  • XPC_SERVICE_NAME
  • LOGNAME
  • TMPDIR
  • SHELL
  • __INTELLIJ_COMMAND_HISTFILE__
  • XPC_FLAGS
  • Apple_PubSub_Socket_Render
  • __CF_USER_TEXT_ENCODING
  • DISPLAY
  • ZDOTDIR
  • PATH
  • TERM
  • SSH_AUTH_SOCK
  • SHLVL
  • PWD
  • OLDPWD
  • ZSH
  • PAGER
  • LESS
  • LSCOLORS
  • LC_CTYPE
  • EDITOR
  • AWS_ACCESS_KEY_ID
  • AWS_SECRET_ACCESS_KEY
  • VIRTUAL_ENV
  • PS1
  • _
  • PIP_DISABLE_PIP_VERSION_CHECK
  • PYTHONDONTWRITEBYTECODE
  • PIP_SHIMS_BASE_MODULE
  • PIP_PYTHON_PATH
  • PYTHONFINDER_IGNORE_UNSUPPORTED

Pipenv–specific environment variables:

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:4
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
dspechnikovcommented, Feb 8, 2022

@matteius The issue is still present for me. Pipenv version 2022.1.8.

0reactions
matteiuscommented, Jul 6, 2022

@elanou Please provide additional details on how to reproduce if this is still happening with pipenv=2022.7.4 Perhaps even open a new issue about it with those details.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Common Pipenv Errors and How to Solve Them: Why Won't it ...
Here, you'll learn how to troubleshoot Pipenv installation and locking issues. ... Typos in the Pipfile are the most common reason that locking...
Read more >
How to fix locking failed in pipenv? - Stack Overflow
Just delete the Pipfile.lock then rerun pipenv lock .
Read more >
pipenv Documentation - Read the Docs
Generates and checks file hashes for locked dependencies when installing from Pipfile.lock. • Automatically install required Python version when pyenv is ...
Read more >
Release and Version History — pipenv 2022.12.20.dev0 ...
Fix for pipenv lock fails for packages with extras as of 2022.8.13 . #5274. Revert the exclusion of BAD_PACKAGES from batch_install in order...
Read more >
pipenv-setup - PyPI
sync Pipfile/Pipfile.lock to setup.py. ... pipenv install --dev "pipenv-setup[black]" # alternatively: ... For example, to synchronize --dev extras:
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