Skip to content

Instantly share code, notes, and snippets.

@mthuurne
Created March 27, 2023 15:25
Show Gist options
  • Save mthuurne/4ee2d1e8a0d5f871c55a23c7788892aa to your computer and use it in GitHub Desktop.
Save mthuurne/4ee2d1e8a0d5f871c55a23c7788892aa to your computer and use it in GitHub Desktop.
Error with `poetry install` in CI
• Updating requests (2.28.1 -> 2.28.2)
• Updating sentry-sdk (1.12.1 -> 1.16.0)
CalledProcessError
Command '['/usr/local/bin/python', '-m', 'pip', 'install', '--disable-pip-version-check', '--isolated', '--no-input', '--prefix', '/usr/local', '--upgrade', '--no-deps', '/root/.cache/pypoetry/artifacts/36/7a/3b/d0e4b6704694b3433d4b3abafe864f67d8454838dc5879096d75e5e440/sentry_sdk-1.16.0-py2.py3-none-any.whl']' returned non-zero exit status 2.
at /usr/local/lib/python3.10/subprocess.py:526 in run
522│ # We don't call process.wait() as .__exit__ does that for us.
523│ raise
524│ retcode = process.poll()
525│ if check and retcode:
→ 526│ raise CalledProcessError(retcode, process.args,
527│ output=stdout, stderr=stderr)
528│ return CompletedProcess(process.args, retcode, stdout, stderr)
529│
530│
The following error occurred when trying to handle this error:
EnvCommandError
Command ['/usr/local/bin/python', '-m', 'pip', 'install', '--disable-pip-version-check', '--isolated', '--no-input', '--prefix', '/usr/local', '--upgrade', '--no-deps', '/root/.cache/pypoetry/artifacts/36/7a/3b/d0e4b6704694b3433d4b3abafe864f67d8454838dc5879096d75e5e440/sentry_sdk-1.16.0-py2.py3-none-any.whl'] errored with the following return code 2, and output:
ERROR: Exception:
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/pip/_internal/cli/base_command.py", line 160, in exc_logging_wrapper
status = run_func(*args)
File "/usr/local/lib/python3.10/site-packages/pip/_internal/cli/req_command.py", line 247, in wrapper
return func(self, options, args)
File "/usr/local/lib/python3.10/site-packages/pip/_internal/commands/install.py", line 326, in run
session = self.get_default_session(options)
File "/usr/local/lib/python3.10/site-packages/pip/_internal/cli/req_command.py", line 98, in get_default_session
self._session = self.enter_context(self._build_session(options))
File "/usr/local/lib/python3.10/site-packages/pip/_internal/cli/req_command.py", line 125, in _build_session
session = PipSession(
File "/usr/local/lib/python3.10/site-packages/pip/_internal/network/session.py", line 343, in __init__
self.headers["User-Agent"] = user_agent()
File "/usr/local/lib/python3.10/site-packages/pip/_internal/network/session.py", line 175, in user_agent
setuptools_dist = get_default_environment().get_distribution("setuptools")
File "/usr/local/lib/python3.10/site-packages/pip/_internal/metadata/__init__.py", line 75, in get_default_environment
return select_backend().Environment.default()
File "/usr/local/lib/python3.10/site-packages/pip/_internal/metadata/__init__.py", line 63, in select_backend
from . import pkg_resources
File "/usr/local/lib/python3.10/site-packages/pip/_internal/metadata/pkg_resources.py", line 8, in <module>
from pip._vendor import pkg_resources
File "/usr/local/lib/python3.10/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3252, in <module>
def _initialize_master_working_set():
File "/usr/local/lib/python3.10/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3235, in _call_aside
f(*args, **kwargs)
File "/usr/local/lib/python3.10/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3287, in _initialize_master_working_set
list(map(working_set.add_entry, sys.path))
File "/usr/local/lib/python3.10/site-packages/pip/_vendor/pkg_resources/__init__.py", line 623, in add_entry
for dist in find_distributions(entry, True):
File "/usr/local/lib/python3.10/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2065, in find_on_path
for dist in factory(fullpath):
File "/usr/local/lib/python3.10/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2127, in distributions_from_metadata
if len(os.listdir(path)) == 0:
FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/lib/python3.10/site-packages/~equests-2.28.1.dist-info'
at /usr/local/lib/python3.10/site-packages/poetry/utils/env.py:1540 in _run
1536│ output = subprocess.check_output(
1537│ command, stderr=subprocess.STDOUT, env=env, **kwargs
1538│ )
1539│ except CalledProcessError as e:
→ 1540│ raise EnvCommandError(e, input=input_)
1541│
1542│ return decode(output)
1543│
1544│ def execute(self, bin: str, *args: str, **kwargs: Any) -> int:
The following error occurred when trying to handle this error:
PoetryException
Failed to install /root/.cache/pypoetry/artifacts/36/7a/3b/d0e4b6704694b3433d4b3abafe864f67d8454838dc5879096d75e5e440/sentry_sdk-1.16.0-py2.py3-none-any.whl
at /usr/local/lib/python3.10/site-packages/poetry/utils/pip.py:58 in pip_install
54│
55│ try:
56│ return environment.run_pip(*args)
57│ except EnvCommandError as e:
→ 58│ raise PoetryException(f"Failed to install {path.as_posix()}") from e
59│
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment