Skip to content

poetry add gdal error #7780

@gitlsl

Description

@gitlsl
  • Poetry (version 1.4.2):
  • **Poetry
    Version: 1.4.2
    Python: 3.10.9

Virtualenv
Python: 3.10.9
Implementation: CPython
Path: E:\pythonout.venv
Executable: E:\pythonout.venv\Scripts\python.exe
Valid: True

System
Platform: win32
OS: nt
Python: 3.10.9
Path: D:\Program Files\Python310
Executable: D:\Program Files\Python310\python.exe**:

  • win11 x64:
  • pyproject.toml:
  • 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 (-vvv option) and have included the output below.

Issue

Stack trace:

7 D:\develop\pipx\pipxhome\venvs\poetry\lib\site-packages\build_init_.py:466 in _handle_backend
464│ def _handle_backend(self, hook: str) -> Iterator[None]:
465│ try:
→ 466│ yield
467│ except pyproject_hooks.BackendUnavailable as exception:
468│ raise BuildBackendException( # noqa: B904 # use raise from

6 D:\develop\pipx\pipxhome\venvs\poetry\lib\site-packages\build_init_.py:459 in _call_backend
457│
458│ with self._handle_backend(hook_name):
→ 459│ basename: str = callback(outdir, config_settings, **kwargs)
460│
461│ return os.path.join(outdir, basename)

5 D:\develop\pipx\pipxhome\venvs\poetry\lib\site-packages\pyproject_hooks_impl.py:209 in build_wheel
207│ if metadata_directory is not None:
208│ metadata_directory = abspath(metadata_directory)
→ 209│ return self._call_hook('build_wheel', {
210│ 'wheel_directory': abspath(wheel_directory),
211│ 'config_settings': config_settings,

4 D:\develop\pipx\pipxhome\venvs\poetry\lib\site-packages\pyproject_hooks_impl.py:311 in _call_hook
309│ with _in_proc_script_path() as script:
310│ python = self.python_executable
→ 311│ self._subprocess_runner(
312│ [python, abspath(str(script)), hook_name, td],
313│ cwd=self.source_dir,

3 D:\develop\pipx\pipxhome\venvs\poetry\lib\site-packages\build_init_.py:302 in _runner
300│ extra_environ = {} if extra_environ is None else dict(extra_environ)
301│ extra_environ['PATH'] = os.pathsep.join(paths)
→ 302│ self._hook_runner(cmd, cwd, extra_environ)
303│
304│ @Property

2 D:\develop\pipx\pipxhome\venvs\poetry\lib\site-packages\pyproject_hooks_impl.py:71 in quiet_subprocess_runner
69│ env.update(extra_environ)
70│
→ 71│ check_output(cmd, cwd=cwd, env=env, stderr=STDOUT)
72│
73│

1 D:\Program Files\Python310\lib\subprocess.py:421 in check_output
419│ kwargs['input'] = empty
420│
→ 421│ return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
422│ **kwargs).stdout
423│

CalledProcessError

Command '['C:\Users\Administrator\AppData\Local\Temp\tmp_xqt9pvo\.venv\Scripts\python.exe', 'D:\develop\pipx\pipxhome\venvs\poetry\lib\site-packages\pyproject_hooks\_in_process\_in_process.py', 'build_wheel', 'C:\Users\Administrator\AppData\Local\Temp\tmpefzkdx24']' returned non-zero exit status 1.

at D:\Program Files\Python310\lib\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:

Stack trace:

4 D:\develop\pipx\pipxhome\venvs\poetry\lib\site-packages\poetry\installation\chef.py:133 in _prepare
131│ )
132│ path = Path(
→ 133│ builder.build(
134│ dist_format,
135│ destination.as_posix(),

3 D:\develop\pipx\pipxhome\venvs\poetry\lib\site-packages\build_init_.py:414 in build
412│ self.log(f'Building {distribution}...')
413│ kwargs = {} if metadata_directory is None else {'metadata_directory': metadata_directory}
→ 414│ return self.call_backend(f'build{distribution}', output_directory, config_settings, **kwargs)
415│
416│ def metadata_path(self, output_directory: PathType) -> str:

2 D:\develop\pipx\pipxhome\venvs\poetry\lib\site-packages\build_init_.py:458 in _call_backend
456│ os.makedirs(outdir)
457│
→ 458│ with self._handle_backend(hook_name):
459│ basename: str = callback(outdir, config_settings, **kwargs)
460│

1 D:\Program Files\Python310\lib\contextlib.py:153 in exit
151│ value = typ()
152│ try:
→ 153│ self.gen.throw(typ, value, traceback)
154│ except StopIteration as exc:
155│ # Suppress StopIteration unless it's the same exception that

BuildBackendException

Backend subprocess exited when trying to invoke build_wheel

at D:\develop\pipx\pipxhome\venvs\poetry\lib\site-packages\build_init_.py:474 in _handle_backend
470│ f"Backend '{self._backend}' is not available.",
471│ sys.exc_info(),
472│ )
473│ except subprocess.CalledProcessError as exception:
→ 474│ raise BuildBackendException( # noqa: B904 # use raise from
475│ exception, f'Backend subprocess exited when trying to invoke {hook}'
476│ )
477│ except Exception as exception:
478│ raise BuildBackendException(exception, exc_info=sys.exc_info()) # noqa: B904 # use raise from

The following error occurred when trying to handle this error:

Stack trace:

8 D:\develop\pipx\pipxhome\venvs\poetry\lib\site-packages\poetry\installation\executor.py:280 in _execute_operation
278│
279│ try:
→ 280│ result = self._do_execute_operation(operation)
281│ except EnvCommandError as e:
282│ if e.e.returncode == -2:

7 D:\develop\pipx\pipxhome\venvs\poetry\lib\site-packages\poetry\installation\executor.py:382 in _do_execute_operation
380│ return 0
381│
→ 382│ result: int = getattr(self, f"execute{method}")(operation)
383│
384│ if result != 0:

6 D:\develop\pipx\pipxhome\venvs\poetry\lib\site-packages\poetry\installation\executor.py:502 in _execute_install
500│
501│ def _execute_install(self, operation: Install | Update) -> int:
→ 502│ status_code = self._install(operation)
503│
504│ self._save_url_reference(operation)

5 D:\develop\pipx\pipxhome\venvs\poetry\lib\site-packages\poetry\installation\executor.py:540 in _install
538│ archive = self._download_link(operation, Link(package.source_url))
539│ else:
→ 540│ archive = self._download(operation)
541│
542│ operation_message = self.get_operation_message(operation)

4 D:\develop\pipx\pipxhome\venvs\poetry\lib\site-packages\poetry\installation\executor.py:715 in _download
713│ self._yanked_warnings.append(message)
714│
→ 715│ return self._download_link(operation, link)
716│
717│ def _download_link(self, operation: Install | Update, link: Link) -> Path:

3 D:\develop\pipx\pipxhome\venvs\poetry\lib\site-packages\poetry\installation\executor.py:751 in _download_link
749│ self._write(operation, message)
750│
→ 751│ archive = self._chef.prepare(archive, output_dir=output_dir)
752│
753│ # Use the original archive to provide the correct hash.

2 D:\develop\pipx\pipxhome\venvs\poetry\lib\site-packages\poetry\installation\chef.py:106 in prepare
104│ return self._prepare(archive, Path(tmp_dir), editable=editable)
105│
→ 106│ return self._prepare_sdist(archive, destination=output_dir)
107│
108│ def _prepare(

1 D:\develop\pipx\pipxhome\venvs\poetry\lib\site-packages\poetry\installation\chef.py:188 in _prepare_sdist
186│ destination.mkdir(parents=True, exist_ok=True)
187│
→ 188│ return self._prepare(
189│ sdist_dir,
190│ destination,

UnicodeDecodeError

'utf-8' codec can't decode byte 0xce in position 16752: invalid continuation byte

at D:\develop\pipx\pipxhome\venvs\poetry\lib\site-packages\poetry\installation\chef.py:146 in _prepare
142│ ):
143│ message_parts.append(
144│ e.exception.stderr.decode()
145│ if e.exception.stderr is not None
→ 146│ else e.exception.stdout.decode()
147│ )
148│
149│ error = ChefBuildError("\n\n".join(message_parts))
150│

poetry add other library work fine, only when add gdal throw above error

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugSomething isn't working as expectedstatus/triageThis issue needs to be triaged

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions