Pipenv: Cannot install local wheel

Created on 26 Jun 2018  路  9Comments  路  Source: pypa/pipenv

Pipenv fails to install local wheel requirements

$ python -m pipenv.help output

Pipenv version: '2018.6.25'

Pipenv location: '/home/kieran/.local/lib/python3.6/site-packages/pipenv'

Python location: '/usr/bin/python3'

Other Python installations in PATH:

  • 2.7: /usr/bin/python2.7
  • 2.7: /usr/bin/python2.7
  • 3.6: /usr/bin/python3.6m
  • 3.6: /usr/bin/python3.6

  • 2.7.14: /usr/bin/python

  • 2.7.14: /usr/bin/python2
  • 3.6.3: /usr/bin/python3

PEP 508 Information:

{'implementation_name': 'cpython',
'implementation_version': '3.6.3',
'os_name': 'posix',
'platform_machine': 'x86_64',
'platform_python_implementation': 'CPython',
'platform_release': '4.13.0-45-generic',
'platform_system': 'Linux',
'platform_version': '#50-Ubuntu SMP Wed May 30 08:23:18 UTC 2018',
'python_full_version': '3.6.3',
'python_version': '3.6',
'sys_platform': 'linux'}

System environment variables:

  • CLUTTER_IM_MODULE
  • LC_ALL
  • LS_COLORS
  • LESSCLOSE
  • XDG_MENU_PREFIX
  • LANG
  • GDM_LANG
  • MANAGERPID
  • DISPLAY
  • INVOCATION_ID
  • UNITY_DEFAULT_PROFILE
  • COMPIZ_CONFIG_PROFILE
  • GTK2_MODULES
  • COLORTERM
  • SSH_AUTH_SOCK
  • MANDATORY_PATH
  • XDG_GREETER_DATA_DIR
  • USER
  • DESKTOP_SESSION
  • QT4_IM_MODULE
  • TEXTDOMAINDIR
  • DEFAULTS_PATH
  • NIX_PATH
  • PWD
  • HOME
  • JOURNAL_STREAM
  • TEXTDOMAIN
  • QT_ACCESSIBILITY
  • XDG_SESSION_TYPE
  • COMPIZ_BIN_PATH
  • XDG_DATA_DIRS
  • XDG_SESSION_DESKTOP
  • SSH_AGENT_LAUNCHER
  • GTK_MODULES
  • GNOME_SESSION_XDG_SESSION_PATH
  • SHELL
  • TERM
  • VTE_VERSION
  • XDG_SEAT_PATH
  • QT_IM_MODULE
  • XMODIFIERS
  • IM_CONFIG_PHASE
  • XDG_CURRENT_DESKTOP
  • UNITY_HAS_3D_SUPPORT
  • NIX_SSL_CERT_FILE
  • SHLVL
  • LANGUAGE
  • WINDOWID
  • GDMSESSION
  • GNOME_DESKTOP_SESSION_ID
  • LOGNAME
  • DBUS_SESSION_BUS_ADDRESS
  • XDG_RUNTIME_DIR
  • XAUTHORITY
  • XDG_SESSION_PATH
  • XDG_CONFIG_DIRS
  • PATH
  • SESSION_MANAGER
  • LESSOPEN
  • GTK_IM_MODULE
  • OLDPWD
  • _
  • PYTHONDONTWRITEBYTECODE
  • PIP_PYTHON_PATH

Pipenv鈥搒pecific environment variables:

Debug鈥搒pecific environment variables:

  • PATH: /home/kieran/.nix-profile/bin:/home/kieran/.nix-profile/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
  • SHELL: /bin/bash
  • LANG: en_US.UTF-8
  • PWD: /home/kieran/Git/pyUmbral

Contents of Pipfile ('/home/kieran/Git/pyUmbral/Pipfile'):

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

[packages]
# Wheels for cryptography until the next release.
cryptography35_linux = { file="./wheelhouse/cryptography-2.3.dev1-cp35-cp35m-linux_x86_64.whl", markers="python_version >= '3.5' and python_version < '3.6' and platform_system == 'Linux'"}
cryptography36_linux = { file="./wheelhouse/cryptography-2.3.dev1-cp36-cp36m-linux_x86_64.whl", markers="python_version >= '3.6' and python_version < '3.7' and platform_system == 'Linux'"}
cryptography36_darwin = { file="./wheelhouse/cryptography-2.3.dev1-cp36-cp36m-macosx_10_13_x86_64.whl", markers="python_version >= '3.6' and python_version < '3.7' and platform_system == 'Darwin'"}

# Use bytestringSplitter from github until we release it on PyPi.
bytestringSplitter = {git = "https://github.com/nucypher/bytestringSplitter.git", ref = "nucypher-depend"}

pynacl = "*"

# Since wheel-specified dependencies aren't locked...
idna = ">=2.1"
asn1crypto = ">=0.21.0"
six = ">=1.4.1"
cffi = ">=1.7"

[dev-packages]
pytest = "*"
coverage = "*"
pytest-cov = "*"
pytest-mock = "*"
codecov = "*"
sphinx = "*"
sphinx-autobuild = "*"

Expected result

Expected a typical installation of specified requirements from local wheel files.

Actual result

Here is the full traceback

Traceback (most recent call last):
  File "/usr/local/bin/pipenv", line 11, in <module>
    sys.exit(cli())
  File "/home/kieran/.local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/home/kieran/.local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/home/kieran/.local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/kieran/.local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/kieran/.local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/home/kieran/.local/lib/python3.6/site-packages/pipenv/cli.py", line 416, in install
    selective_upgrade=selective_upgrade,
  File "/home/kieran/.local/lib/python3.6/site-packages/pipenv/core.py", line 1972, in do_install
    pypi_mirror=pypi_mirror,
  File "/home/kieran/.local/lib/python3.6/site-packages/pipenv/core.py", line 1346, in do_init
    pypi_mirror=pypi_mirror,
  File "/home/kieran/.local/lib/python3.6/site-packages/pipenv/core.py", line 1070, in do_lock
    settings['packages'], project, r=False, include_index=True
  File "/home/kieran/.local/lib/python3.6/site-packages/pipenv/utils.py", line 514, in convert_deps_to_pip
    new_dep = Requirement.from_pipfile(dep_name, dep)
  File "/home/kieran/.local/lib/python3.6/site-packages/pipenv/vendor/requirementslib/models/requirements.py", line 754, in from_pipfile
    r = FileRequirement.from_pipfile(name, pipfile)
  File "/home/kieran/.local/lib/python3.6/site-packages/pipenv/vendor/requirementslib/models/requirements.py", line 384, in from_pipfile
    return cls(**arg_dict)
  File "<attrs generated init f149d54d8cf3d1a20ad51a75414105134a7d3eb0>", line 20, in __init__
  File "/home/kieran/.local/lib/python3.6/site-packages/pipenv/vendor/requirementslib/models/requirements.py", line 281, in get_requirement
    req = first(requirements.parse(line))
  File "/home/kieran/.local/lib/python3.6/site-packages/pipenv/vendor/first.py", line 70, in first
    for el in iterable:
  File "/home/kieran/.local/lib/python3.6/site-packages/pipenv/vendor/requirements/parser.py", line 50, in parse
    yield Requirement.parse(line)
  File "/home/kieran/.local/lib/python3.6/site-packages/pipenv/vendor/requirements/requirement.py", line 220, in parse
    return cls.parse_line(line)
  File "/home/kieran/.local/lib/python3.6/site-packages/pipenv/vendor/requirements/requirement.py", line 198, in parse_line
    pkg_req = Req.parse(line)
  File "/home/kieran/.local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2988, in parse
    req, = parse_requirements(s)
  File "/home/kieran/.local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2935, in parse_requirements
    yield Requirement(line)
  File "/home/kieran/.local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2944, in __init__
    raise RequirementParseError(str(e))
pkg_resources.RequirementParseError: Invalid requirement, parse error at "'./wheelh'"

Steps to replicate
  1. Install pipenv 2018.6.25
  2. Create a pipfile that references a local wheel file as a requirement
  3. run pipenv install

Most helpful comment

Ok @KPrasch I think I figured out the issue, the syntax to specify a wheel in a pipfile looks like this:

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

[packages]
requests = {path = "./wheelhouse/requests-2.19.1-py2.py3-none-any.whl"}

[dev-packages]

You'll notice that instead if file we have used path. Try changing it and then doing a pipenv lock!

All 9 comments

hi @KPrasch, thanks for using pipenv! I'm looking into this issue. Hold tight!

Ok @KPrasch I think I figured out the issue, the syntax to specify a wheel in a pipfile looks like this:

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

[packages]
requests = {path = "./wheelhouse/requests-2.19.1-py2.py3-none-any.whl"}

[dev-packages]

You'll notice that instead if file we have used path. Try changing it and then doing a pipenv lock!

Ah, okay! Thanks for finding this! For future reference, where can I find this documented?

I'm honestly not sure, I got the syntax from doing pipenv install ./wheelhouse/requests-2.19.1-py2.py3-none-any.whl and then looking at the generated Pipfile. If I don't find it in the docs a section may need to be created for it, feel free to make a contribution!

Ok!

For the record, something must've changed with version 2018.6.25, since we were installing .whl files using "file" as the the inline table key with prior versions of pipenv without issues; downgrading pipenv also fixes the issue.

Thanks again for your help!

I'm checking to see if this is a regression, in the meantime I have this explanation:

path is for relative paths to packages or wheels
file is for uris

I can confirm this is not a regression and was added in #540

hey @KPrasch sorry for the confusion, the file key may have worked in the prior release, but if it did it was an accident :( file is meant for URIs only -- the path key is for relative paths. That's why we have two separate keys

If this was possible in the last release I expect we're going to hear more about it so we're going to have to be prepared for this a bit more in the coming days. Sorry for the confusion and thanks for filing this issue!

Thanks for the quick responses and all your great work! :-)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

FooBarQuaxx picture FooBarQuaxx  路  3Comments

jacebrowning picture jacebrowning  路  3Comments

bgjelstrup picture bgjelstrup  路  3Comments

erinxocon picture erinxocon  路  3Comments

marc-fez picture marc-fez  路  3Comments