-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Closed
Labels
area/installerRelated to the dependency installerRelated to the dependency installerkind/bugSomething isn't working as expectedSomething isn't working as expected
Description
- Poetry version: 1.7.0
- Python version: 3.10.8
- OS version and name: Ubuntu 22.04. base docker image:
nvidia/cuda:11.8.0-cudnn8-runtime-ubuntu22.04 - pyproject.toml: https://gist.github.com/CallumJHays/af8252187ea4f7ed783d35ef19229c72 (+Dockerfile)
- I am on the latest stable Poetry version, installed using a recommended method.
- I have searched the issues of this repo and believe that this is not a duplicate.
- I have consulted the FAQ and blog for any relevant entries or release notes.
- If an exception occurs when executing a command, I executed it again in debug mode (
-vvvoption) and have included the output below.
Issue
I'm running into a [Errno 2] No such file or directory: '/usr/pyvenv.cfg' error when trying to run poetry add or poetry install within a docker container based on nvidia/cuda:11.8.0-cudnn8-runtime-ubuntu22.04.
Debugging Details:
- The issue does not occur in
1.6.1- only1.7.0 - The issue does not occur with a different base image (ie
FROM python:3.10)- clearly something in the nvidia image is causing the problems - but not sure what.
- The issue does not occur unless
poetry config virtual-envs.create false
I included a Dockerfile in my attached gist, with the build args POETRY_VERSION and POETRY_VIRTUALENVS_CREATE to help isolate the issue. The error can be demonstrated with the following command:
docker build . --build-arg POETRY_VERSION=1.7.0 --build-arg POETRY_VIRTUALENVS_CREATE=falseThe docker build fails on the last step (RUN poetry add six -vvv), and produces the following output. PS: the package used to test (six) is arbitrary - it fails for any package I've tried
> [7/7] RUN poetry add six -vvv:
0.452 Loading configuration file /root/.config/pypoetry/config.toml
0.463 Skipping virtualenv creation, as specified in config file.
0.531
0.531 Stack trace:
0.531
0.531 17 ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/cleo/application.py:327 in run
0.543 325│
0.543 326│ try:
0.543 → 327│ exit_code = self._run(io)
0.543 328│ except BrokenPipeError:
0.543 329│ # If we are piped to another process, it may close early and send a
0.543
0.543 16 ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/poetry/console/application.py:190 in _run
0.549 188│ self._load_plugins(io)
0.549 189│
0.549 → 190│ exit_code: int = super()._run(io)
0.549 191│ return exit_code
0.549 192│
0.549
0.549 15 ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/cleo/application.py:431 in _run
0.558 429│ io.input.interactive(interactive)
0.558 430│
0.558 → 431│ exit_code = self._run_command(command, io)
0.558 432│ self._running_command = None
0.558 433│
0.558
0.558 14 ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/cleo/application.py:473 in _run_command
0.567 471│
0.567 472│ if error is not None:
0.567 → 473│ raise error
0.567 474│
0.567 475│ return terminate_event.exit_code
0.567
0.567 13 ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/cleo/application.py:454 in _run_command
0.576 452│
0.576 453│ try:
0.576 → 454│ self._event_dispatcher.dispatch(command_event, COMMAND)
0.576 455│
0.576 456│ if command_event.command_should_run():
0.576
0.576 12 ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/cleo/events/event_dispatcher.py:26 in dispatch
0.578 24│
0.578 25│ if listeners:
0.578 → 26│ self._do_dispatch(listeners, event_name, event)
0.578 27│
0.578 28│ return event
0.578
0.578 11 ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/cleo/events/event_dispatcher.py:85 in _do_dispatch
0.579 83│ break
0.579 84│
0.579 → 85│ listener(event, event_name, self)
0.579 86│
0.579 87│ def _sort_listeners(self, event_name: str) -> None:
0.579
0.579 10 ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/poetry/console/application.py:322 in configure_installer_for_event
0.585 320│ return
0.585 321│
0.585 → 322│ cls.configure_installer_for_command(command, event.io)
0.585 323│
0.585 324│ @staticmethod
0.585
0.585 9 ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/poetry/console/application.py:329 in configure_installer_for_command
0.591 327│
0.591 328│ poetry = command.poetry
0.591 → 329│ installer = Installer(
0.591 330│ io,
0.591 331│ command.env,
0.591
0.591 8 ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/poetry/installation/installer.py:74 in __init__
0.597 72│
0.597 73│ if installed is None:
0.597 → 74│ installed = self._get_installed()
0.597 75│
0.597 76│ self._installed_repository = installed
0.598
0.598 7 ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/poetry/installation/installer.py:443 in _get_installed
0.604 441│
0.604 442│ def _get_installed(self) -> InstalledRepository:
0.604 → 443│ return InstalledRepository.load(self._env)
0.604 444│
0.604
0.604 6 ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/poetry/repositories/installed_repository.py:274 in load
0.608 272│ continue
0.608 273│
0.608 → 274│ package = cls.create_package_from_distribution(distribution, env)
0.608 275│
0.608 276│ if with_dependencies:
0.608
0.608 5 ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/poetry/repositories/installed_repository.py:112 in create_package_from_distribution
0.612 110│ return cls.create_package_from_pep610(distribution)
0.612 111│
0.612 → 112│ is_standard_package = env.is_path_relative_to_lib(path)
0.612 113│
0.612 114│ source_type = None
0.612
0.612 4 ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/poetry/utils/env/virtual_env.py:154 in is_path_relative_to_lib
0.615 152│ def is_path_relative_to_lib(self, path: Path) -> bool:
0.615 153│ return super().is_path_relative_to_lib(path) or (
0.615 → 154│ self.includes_system_site_packages
0.615 155│ and SystemEnv(Path(sys.prefix)).is_path_relative_to_lib(path)
0.615 156│ )
0.615
0.615 3 /usr/lib/python3.10/functools.py:981 in __get__
0.628 979│ val = cache.get(self.attrname, _NOT_FOUND)
0.628 980│ if val is _NOT_FOUND:
0.628 → 981│ val = self.func(instance)
0.628 982│ try:
0.628 983│ cache[self.attrname] = val
0.628
0.628 2 ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/poetry/utils/env/virtual_env.py:146 in includes_system_site_packages
0.631 144│ re.search(
0.631 145│ r"^\s*include-system-site-packages\s*=\s*true\s*$",
0.631 → 146│ pyvenv_cfg.read_text(),
0.631 147│ re.IGNORECASE | re.MULTILINE,
0.631 148│ )
0.631
0.631 1 /usr/lib/python3.10/pathlib.py:1134 in read_text
0.651 1132│ """
0.651 1133│ encoding = io.text_encoding(encoding)
0.651 → 1134│ with self.open(mode='r', encoding=encoding, errors=errors) as f:
0.651 1135│ return f.read()
0.651 1136│
0.651
0.651 FileNotFoundError
0.651
0.651 [Errno 2] No such file or directory: '/usr/pyvenv.cfg'
0.651
0.651 at /usr/lib/python3.10/pathlib.py:1119 in open
0.670 1115│ the built-in open() function does.
0.670 1116│ """
0.670 1117│ if "b" not in mode:
0.670 1118│ encoding = io.text_encoding(encoding)
0.670 → 1119│ return self._accessor.open(self, mode, buffering, encoding, errors,
0.670 1120│ newline)
0.670 1121│
0.670 1122│ def read_bytes(self):
0.670 1123│ """
------
Dockerfile:18
--------------------
16 |
17 | COPY pyproject.toml .
18 | >>> RUN poetry add six -vvv
--------------------
ERROR: failed to solve: process "/bin/sh -c poetry add six -vvv" did not complete successfully: exit code: 1Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area/installerRelated to the dependency installerRelated to the dependency installerkind/bugSomething isn't working as expectedSomething isn't working as expected