nekitdev/gd.py

"FileNotFoundError: No such file or directory: "poetry"" while building gd.py

Closed this issue · 3 comments

Hello, I'm trying to install gd.py but it gaves the following error:

Building wheels for collected packages: gd.py, xor-cipher
  Building wheel for gd.py (PEP 517) ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/bin/python3 /tmp/tmpntpk9edj build_wheel /tmp/tmp_sh3uzx5
       cwd: /tmp/pip-install-upezismm/gd.py
  Complete output (38 lines):
  Traceback (most recent call last):
    File "build.py", line 87, in <module>
      def main() -> None:
    File "/tmp/pip-build-env-g1xfycao/overlay/lib/python3.8/site-packages/entrypoint/core.py", line 41, in __call__
      return self.call(main)
    File "/tmp/pip-build-env-g1xfycao/overlay/lib/python3.8/site-packages/entrypoint/core.py", line 36, in call
      main()
    File "build.py", line 88, in main
      build({})  # type: ignore
    File "build.py", line 57, in build
      result = call(build_command(output_path))
    File "/usr/lib/python3.8/subprocess.py", line 340, in call
      with Popen(*popenargs, **kwargs) as p:
    File "/usr/lib/python3.8/subprocess.py", line 858, in __init__
      self._execute_child(args, executable, preexec_fn, close_fds,
    File "/usr/lib/python3.8/subprocess.py", line 1704, in _execute_child
      raise child_exception_type(errno_num, err_msg, err_filename)
  FileNotFoundError: [Errno 2] No such file or directory: 'poetry'
  Traceback (most recent call last):
    File "/tmp/tmpntpk9edj", line 280, in <module>
      main()
    File "/tmp/tmpntpk9edj", line 263, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "/tmp/tmpntpk9edj", line 204, in build_wheel
      return _build_backend().build_wheel(wheel_directory, config_settings,
    File "/tmp/pip-build-env-g1xfycao/overlay/lib/python3.8/site-packages/poetry/core/masonry/api.py", line 57, in build_wheel
      return WheelBuilder.make_in(
    File "/tmp/pip-build-env-g1xfycao/overlay/lib/python3.8/site-packages/poetry/core/masonry/builders/wheel.py", line 87, in make_in
      wb.build(target_dir=directory)
    File "/tmp/pip-build-env-g1xfycao/overlay/lib/python3.8/site-packages/poetry/core/masonry/builders/wheel.py", line 122, in build
      self._build(zip_file)
    File "/tmp/pip-build-env-g1xfycao/overlay/lib/python3.8/site-packages/poetry/core/masonry/builders/wheel.py", line 171, in _build
      self._run_build_script(self._package.build_script)
    File "/tmp/pip-build-env-g1xfycao/overlay/lib/python3.8/site-packages/poetry/core/masonry/builders/wheel.py", line 231, in _run_build_script
      subprocess.check_call([self.executable.as_posix(), build_script])
    File "/usr/lib/python3.8/subprocess.py", line 364, in check_call
      raise CalledProcessError(retcode, cmd)
  subprocess.CalledProcessError: Command '['/usr/bin/python3', 'build.py']' returned non-zero exit status 1.
  ----------------------------------------
  ERROR: Failed building wheel for gd.py

I have installed rustc, lxml, fastapi, and I have tried with the GitHub repository ZIP but nothing works.
Installing the package using poetry does not solve the problem, it creates annother one:

python3 -m poetry add gd.py
Creating virtualenv gd-py-nIRGA3ZT-py3.8 in /home/zorin/.cache/pypoetry/virtualenvs

cannot import name 'BuildBackendException' from 'build' (/home/zorin/gd.py/build.py)

Can someone help please ? Thanks.
Errors are the same/I tested on Python 3.8 and Python 3.11 on Linux.

As a workaround, you can install poetry separately:
pip install poetry poetry-kernel

Could you try installing from source? I've removed rust extensions in the upcoming release of gd.py as they didn't give substantial speedups.

This issue can not be reproduced anymore since gd.py does not use poetry when building anymore.