Skip to content

Pipenv fails to install extras from Pipfile.lock #4407

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

Closed
rfrowe opened this issue Jul 29, 2020 · 9 comments
Closed

Pipenv fails to install extras from Pipfile.lock #4407

rfrowe opened this issue Jul 29, 2020 · 9 comments
Labels
Status: Awaiting Update ⏳ This issue requires more information before assistance can be provided.

Comments

@rfrowe
Copy link

rfrowe commented Jul 29, 2020

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 = "[email protected]/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": "[email protected]/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/[email protected]/bin/python3.8'

Python installations found:

  • 3.8.1: /usr/local/opt/[email protected]/bin/python3
  • 3.8.1: /usr/local/opt/[email protected]/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:

@ghost ghost added the triage label Jul 29, 2020
@frostming
Copy link
Contributor

Regenerate the lock file by pipenv lock --clear and try again.

@frostming frostming added Status: Awaiting Update ⏳ This issue requires more information before assistance can be provided. Status: Needs More Information This issue does not provide enough information to take further action. labels Aug 4, 2020
@ghost ghost removed the triage label Aug 4, 2020
@helper2424
Copy link

The same issue with pipenv, it ignores extras at all.

@ElijahSink
Copy link

I can confirm this issue. pipenv will only install the extra dependencies if directly instructed to via
pipenv install <package>[extras]. Even with that method, the extra dependencies only show up in pipenv graph, and are not present in the Pipfile.lock.

@matteius
Copy link
Member

matteius commented Dec 22, 2021

@rfrowe or @ElijahSink Could you recheck with latest version of pipenv pipenv==2021.11.23?

@dspechnikov
Copy link

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

@matteius
Copy link
Member

matteius commented Apr 21, 2022

@dspechnikov Can you check again with 2022.4.21 and if so we can elevate the priority. Please also provide a recent example to triage with. Thank you!

@matteius matteius removed the Status: Needs More Information This issue does not provide enough information to take further action. label Apr 21, 2022
@dspechnikov
Copy link

@matteius looks good.

Also actually I double-checked 2022.1.8 with fastapi {extras="all"} on clean env, and it worked as well (deps were added to lock file and installed).

@elanou
Copy link

elanou commented May 20, 2022

This is stilling happening in Release v2022.5.2

@matteius
Copy link
Member

matteius commented 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Awaiting Update ⏳ This issue requires more information before assistance can be provided.
Projects
None yet
Development

No branches or pull requests

7 participants