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.72.7: /usr/bin/python2.73.6: /usr/bin/python3.6m3.6: /usr/bin/python3.6
2.7.14: /usr/bin/python
2.7.14: /usr/bin/python23.6.3: /usr/bin/python3PEP 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_MODULELC_ALLLS_COLORSLESSCLOSEXDG_MENU_PREFIXLANGGDM_LANGMANAGERPIDDISPLAYINVOCATION_IDUNITY_DEFAULT_PROFILECOMPIZ_CONFIG_PROFILEGTK2_MODULESCOLORTERMSSH_AUTH_SOCKMANDATORY_PATHXDG_GREETER_DATA_DIRUSERDESKTOP_SESSIONQT4_IM_MODULETEXTDOMAINDIRDEFAULTS_PATHNIX_PATHPWDHOMEJOURNAL_STREAMTEXTDOMAINQT_ACCESSIBILITYXDG_SESSION_TYPECOMPIZ_BIN_PATHXDG_DATA_DIRSXDG_SESSION_DESKTOPSSH_AGENT_LAUNCHERGTK_MODULESGNOME_SESSION_XDG_SESSION_PATHSHELLTERMVTE_VERSIONXDG_SEAT_PATHQT_IM_MODULEXMODIFIERSIM_CONFIG_PHASEXDG_CURRENT_DESKTOPUNITY_HAS_3D_SUPPORTNIX_SSL_CERT_FILESHLVLLANGUAGEWINDOWIDGDMSESSIONGNOME_DESKTOP_SESSION_IDLOGNAMEDBUS_SESSION_BUS_ADDRESSXDG_RUNTIME_DIRXAUTHORITYXDG_SESSION_PATHXDG_CONFIG_DIRSPATHSESSION_MANAGERLESSOPENGTK_IM_MODULEOLDPWD_PYTHONDONTWRITEBYTECODEPIP_PYTHON_PATHPipenv鈥搒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/binSHELL: /bin/bashLANG: en_US.UTF-8PWD: /home/kieran/Git/pyUmbralContents 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 a typical installation of specified requirements from local wheel files.
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'"
pipenv installhi @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! :-)
Most helpful comment
Ok @KPrasch I think I figured out the issue, the syntax to specify a wheel in a pipfile looks like this:
You'll notice that instead if
filewe have usedpath. Try changing it and then doing apipenv lock!