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.

Lockfile: missing `pip.log`

See original GitHub issue

Using Pex 2.71 and the Docker image quay.io/pypa/manylinux2014_x86_64:latest, I get this failure:

PEX_SCRIPT=pex3 /opt/python/cp37-cp37m/bin/python ./pex lock create --resolver-version=pip-2020-resolver ansicolors
Traceback (most recent call last):
  File "/root/.pex/venvs/685195326480c4d9d521e9cc3994b066950eeb1e/f084cae1efd893aa7ecfef66d45dea1a5e619caa/pex", line 126, in <module>
    os.execv(script_path, [script_path] + sys.argv[1:])
FileNotFoundError: [Errno 2] No such file or directory
Traceback (most recent call last):
  File "/root/.pex/unzipped_pexes/3c037481d92e64c70b4c4d598b63e24e6c2bb819/.bootstrap/pex/pex.py", line 503, in execute
    exit_value = self._wrap_coverage(self._wrap_profiling, self._execute)
  File "/root/.pex/unzipped_pexes/3c037481d92e64c70b4c4d598b63e24e6c2bb819/.bootstrap/pex/pex.py", line 408, in _wrap_coverage
    return runner(*args)
  File "/root/.pex/unzipped_pexes/3c037481d92e64c70b4c4d598b63e24e6c2bb819/.bootstrap/pex/pex.py", line 439, in _wrap_profiling
    return runner(*args)
  File "/root/.pex/unzipped_pexes/3c037481d92e64c70b4c4d598b63e24e6c2bb819/.bootstrap/pex/pex.py", line 553, in _execute
    return self.execute_script(self._pex_info_overrides.script)
  File "/root/.pex/unzipped_pexes/3c037481d92e64c70b4c4d598b63e24e6c2bb819/.bootstrap/pex/pex.py", line 635, in execute_script
    return self.execute_entry(entry_point)
  File "/root/.pex/unzipped_pexes/3c037481d92e64c70b4c4d598b63e24e6c2bb819/.bootstrap/pex/pex.py", line 695, in execute_entry
    return self.execute_pkg_resources(entry_point)
  File "/root/.pex/unzipped_pexes/3c037481d92e64c70b4c4d598b63e24e6c2bb819/.bootstrap/pex/pex.py", line 727, in execute_pkg_resources
    return runner()
  File "/root/.pex/installed_wheels/9fb4bc59f7085c6133bed415fd8806a166d6f472798f2350158f7f0a710ec0f6/pex-2.1.71-py2.py3-none-any.whl/pex/cli/pex.py", line 30, in main
    result = catch(command.run)
  File "/root/.pex/installed_wheels/9fb4bc59f7085c6133bed415fd8806a166d6f472798f2350158f7f0a710ec0f6/pex-2.1.71-py2.py3-none-any.whl/pex/result.py", line 101, in catch
    return func(*args, **kwargs)
  File "/root/.pex/installed_wheels/9fb4bc59f7085c6133bed415fd8806a166d6f472798f2350158f7f0a710ec0f6/pex-2.1.71-py2.py3-none-any.whl/pex/cli/command.py", line 84, in run
    return subcommand_func(self)
  File "/root/.pex/installed_wheels/9fb4bc59f7085c6133bed415fd8806a166d6f472798f2350158f7f0a710ec0f6/pex-2.1.71-py2.py3-none-any.whl/pex/cli/commands/lock.py", line 248, in _create
    pip_configuration=pip_configuration,
  File "/root/.pex/installed_wheels/9fb4bc59f7085c6133bed415fd8806a166d6f472798f2350158f7f0a710ec0f6/pex-2.1.71-py2.py3-none-any.whl/pex/resolve/lockfile/__init__.py", line 253, in create
    dest=dest,
  File "/root/.pex/installed_wheels/9fb4bc59f7085c6133bed415fd8806a166d6f472798f2350158f7f0a710ec0f6/pex-2.1.71-py2.py3-none-any.whl/pex/resolver.py", line 1200, in download
    lock_configuration=lock_configuration,
  File "/root/.pex/installed_wheels/9fb4bc59f7085c6133bed415fd8806a166d6f472798f2350158f7f0a710ec0f6/pex-2.1.71-py2.py3-none-any.whl/pex/resolver.py", line 1086, in _download_internal
    dest=dest, max_parallel_jobs=max_parallel_jobs
  File "/root/.pex/installed_wheels/9fb4bc59f7085c6133bed415fd8806a166d6f472798f2350158f7f0a710ec0f6/pex-2.1.71-py2.py3-none-any.whl/pex/resolver.py", line 141, in download_distributions
    max_jobs=max_parallel_jobs,
  File "/root/.pex/installed_wheels/9fb4bc59f7085c6133bed415fd8806a166d6f472798f2350158f7f0a710ec0f6/pex-2.1.71-py2.py3-none-any.whl/pex/jobs.py", line 512, in execute_parallel
    yield spawn_result.spawned_job.await_result()
  File "/root/.pex/installed_wheels/9fb4bc59f7085c6133bed415fd8806a166d6f472798f2350158f7f0a710ec0f6/pex-2.1.71-py2.py3-none-any.whl/pex/jobs.py", line 216, in await_result
    job.wait()
  File "/root/.pex/installed_wheels/9fb4bc59f7085c6133bed415fd8806a166d6f472798f2350158f7f0a710ec0f6/pex-2.1.71-py2.py3-none-any.whl/pex/jobs.py", line 75, in wait
    self._check_returncode(stderr)
  File "/root/.pex/installed_wheels/9fb4bc59f7085c6133bed415fd8806a166d6f472798f2350158f7f0a710ec0f6/pex-2.1.71-py2.py3-none-any.whl/pex/pip.py", line 450, in _check_returncode
    with open(self._log, "r") as fp:
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/tmp8czrmzg8/pip.log'

It’s deterministic, but I can’t get it to happen on my mac. Using the old resolver returns this error.

Traceback (most recent call last):
  File "/root/.pex/venvs/685195326480c4d9d521e9cc3994b066950eeb1e/f084cae1efd893aa7ecfef66d45dea1a5e619caa/pex", line 126, in <module>
    os.execv(script_path, [script_path] + sys.argv[1:])
FileNotFoundError: [Errno 2] No such file or directory
pid 751 -> /root/.pex/venvs/685195326480c4d9d521e9cc3994b066950eeb1e/f084cae1efd893aa7ecfef66d45dea1a5e619caa/pex --disable-pip-version-check --no-python-version-warning --exists-action a --use-deprecated legacy-resolver --isolated -q --cache-dir /root/.pex --log /tmp/tmpu7jsac5m/pip.log download --dest /tmp/tmpdpb9zdq_/opt._internal.cpython-3.7.12.bin.python3.7 ansicolors --index-url https://pypi.org/simple --retries 5 --timeout 15 exited with 1 and STDERR:
None

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
jsiroiscommented, Mar 15, 2022

Yeah, this never worked. Iff you 1st ran the Pex PEX without PEX_SCRIPT=... and the PEX_ROOT got populated with a Pip venv clear of that, then things would work.

2reactions
jsiroiscommented, Mar 15, 2022

Noting this is specifically a Pex PEX issue. Eric’s odd looking choice of means to execute Pex here is intended (I think) and the issue. Pants executes Pex this way. It’s also worth pointing out this has nothing to do with pip.log or locking. The error is earlier trying to re-direct to the pex3 script. It’s also worth noting this has nothing to do with docker, I can get the error on a bare Arch machine. It’s also sensitive to how the ~/.pex cache was populated. I can make the error go away by populating the ~/.pex cache else-wise in hand-wavy ways. If I nuke the cache though and run Eric’s command, I can get failure every time; i.e.: when unzipping and venv creation are initiated from the Pex PEX.

Read more comments on GitHub >

github_iconTop Results From Across the Web

try to create a lock file but failed · Issue #4410 · pypa/pipenv
I run the pipenv shell first, it is all fine. When I run pipenv install django, the pipenv success to download the django...
Read more >
How are Pipfile and Pipfile.lock used? - Stack Overflow
The Pipfile file is intended to specify packages requirements for your Python application or library, both to development and execution. You can ...
Read more >
Common Pipenv Errors and How to Solve Them: Why Won't it ...
When you begin a project with Pipenv, the tool automatically creates a virtual environment, a Pipfile, and a Pipfile.lock. The Pipfile is very...
Read more >
zc.lockfile - PyPI
pip install zc.lockfile ... Stop logging failure to acquire locks. ... Fixed: when there was lock contention, the pid in the lock file...
Read more >
How to fix "Could not open lock file" because "Permission ...
I got the error with running sudo apt update && apt upgrade , where sudo was missing from the 2nd apt statement.
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