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.

Cannot install local wheel

See original GitHub issue

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–specific environment variables:

Debug–specific 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

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
erinxoconcommented, Jun 26, 2018

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!

1reaction
techalchemycommented, Jun 26, 2018

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!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Trouble installing local wheel file · Issue #352 · pypa/pipx
I tried to run pipx install qualpy-1.0.0-py3-none-any.whl and I would get a Cannot determine package name from spec 'qualpy-0.0.1-py3 ...
Read more >
pip wont install .WHL files - python - Stack Overflow
Wheels are not even supposed to have a setup.py inside. Try upgrading pip with pip install --upgrade pip and then running the command...
Read more >
How to install, download and build Python wheels - ActiveState
Open source Python packages can be installed from Source Distributions (sdist) or Wheels (whl). According to the Python Packaging Authority ...
Read more >
User Guide - pip documentation v22.3.1
To build wheels for your requirements and all their dependencies to a local directory: Unix/macOS. python -m pip install wheel python -m pip...
Read more >
How to Install a Python Package with a .whl File? - Finxter
The purpose of a wheel is to contain all files for a PEP-compliant installation that approximately matches the on-disk format. It allows you...
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