<#2057 Internal `not enough values to unpack` erro...
# github-notifications
q
#2057 Internal `not enough values to unpack` error for `pex3 lock create 'pip @ https://github.com/pypa/pip/archive/22.0.2.zip' ...` Issue created by huonw I'm trying to create a lock file with a requirement like
pip @ <https://github.com/pypa/pip/archive/22.0.2.zip>
. Pex fails with a very opaque error from an uncaught `ValueError`:
not enough values to unpack
. Potentially I'm doing something that's not supported. If so, I'd be hoping for a more explanatory error message than the raw exception. Workaround For a Github archive URL like that, it seems like
git
requirement like
pip @ git+<https://github.com/pypa/pip@22.0.2>
works instead. Reproducer
Copy code
pex3 --version # 2.1.122
PEX_VERBOSE=1 pex3 -v lock create 'pip @ <https://github.com/pypa/pip/archive/22.0.2.zip>' --output=lock.json
(That requirement spec is taken from https://pip.pypa.io/en/stable/reference/requirement-specifiers/#examples, and indeed
pip install 'pip @ <https://github.com/pypa/pip/archive/22.0.2.zip>'
seems to work.) Output (running under 3.9, on macOS):
Copy code
pex: Resolving for:
pex: Hashing pex: 82.0ms                                              
pex: Isolating pex: 0.0ms
Traceback (most recent call last):
  File "/Users/huon/.pyenv/versions/3.9.10/lib/python3.9/site-packages/pex/result.py", line 105, in catch
    return func(*args, **kwargs)
  File "/Users/huon/.pyenv/versions/3.9.10/lib/python3.9/site-packages/pex/cli/command.py", line 84, in run
    return subcommand_func(self)
  File "/Users/huon/.pyenv/versions/3.9.10/lib/python3.9/site-packages/pex/cli/commands/lock.py", line 448, in _create
    create(
  File "/Users/huon/.pyenv/versions/3.9.10/lib/python3.9/site-packages/pex/resolve/lockfile/create.py", line 378, in create
    downloaded = resolver.download(
  File "/Users/huon/.pyenv/versions/3.9.10/lib/python3.9/site-packages/pex/resolver.py", line 1232, in download
    build_requests, download_results = _download_internal(
  File "/Users/huon/.pyenv/versions/3.9.10/lib/python3.9/site-packages/pex/resolver.py", line 1117, in _download_internal
    download_results = download_request.download_distributions(
  File "/Users/huon/.pyenv/versions/3.9.10/lib/python3.9/site-packages/pex/resolver.py", line 111, in download_distributions
    return list(
  File "/Users/huon/.pyenv/versions/3.9.10/lib/python3.9/site-packages/pex/jobs.py", line 586, in execute_parallel
    yield spawn_result.spawned_job.await_result()
  File "/Users/huon/.pyenv/versions/3.9.10/lib/python3.9/site-packages/pex/jobs.py", line 222, in await_result
    job.wait()
  File "/Users/huon/.pyenv/versions/3.9.10/lib/python3.9/site-packages/pex/jobs.py", line 81, in wait
    self._check_returncode(stderr)
  File "/Users/huon/.pyenv/versions/3.9.10/lib/python3.9/site-packages/pex/pip/log_analyzer.py", line 104, in _check_returncode
    result = analyzer.analyze(line)
  File "/Users/huon/.pyenv/versions/3.9.10/lib/python3.9/site-packages/pex/resolve/locker.py", line 412, in analyze
    project_name_and_version, partial_artifact = self._extract_resolve_data(url)
  File "/Users/huon/.pyenv/versions/3.9.10/lib/python3.9/site-packages/pex/resolve/locker.py", line 264, in _extract_resolve_data
    ProjectNameAndVersion.from_filename(unquote(urlparse.urlparse(url).path))
  File "/Users/huon/.pyenv/versions/3.9.10/lib/python3.9/site-packages/pex/dist_metadata.py", line 294, in from_filename
    project_name, version = fname.rsplit("-", 1)
ValueError: not enough values to unpack (expected 2, got 1)
not enough values to unpack (expected 2, got 1)
• The default output (without
PEX_VERBOSE
) is just the exception message
not enough values to unpack (expected 2, got 1)
. • Running under other Python versions (e.g. 3.10) and other systems (e.g. a Linux docker image) gives similar output. pantsbuild/pex