Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't Add Package #8656

Closed
4 tasks done
canine-afficionado opened this issue Nov 13, 2023 · 6 comments
Closed
4 tasks done

Can't Add Package #8656

canine-afficionado opened this issue Nov 13, 2023 · 6 comments
Labels
kind/bug Something isn't working as expected

Comments

@canine-afficionado
Copy link

  • 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

Hello and thanks for this fantastic tool.

I cannot get poetry to add a package on my ubuntu system. It works fine on my macOS development machine and on a hosted linux machine. It also works OK if I switch to a poetry shell and install it using pip.

I thought perhaps this patch might have fixed it so I installed the git version but the problem persists.

Here's the output:

$ poetry -vvv add fast-bencode
Loading configuration file /home/ubuntu/.config/pypoetry/config.toml
Using virtualenv: /home/ubuntu/poetry_test/.venv
No suitable keyring backend found
No suitable keyring backends were found
Keyring is not available, credentials will be stored and retrieved from configuration files as plaintext.
Creating new session for pypi.org
Source (PyPI): 7 packages found for fast-bencode *
Using version ^1.1.4 for fast-bencode

Updating dependencies
Resolving dependencies...
   1: fact: poetry-test is 0.1.0
   1: derived: poetry-test
   1: fact: poetry-test depends on fast-bencode (^1.1.4)
   1: selecting poetry-test (0.1.0)
   1: derived: fast-bencode (>=1.1.4,<2.0.0)
Source (PyPI): 1 packages found for fast-bencode >=1.1.4,<2.0.0
   1: selecting fast-bencode (1.1.4)
   1: Version solving took 0.018 seconds.
   1: Tried 1 solutions.

Finding the necessary packages for the current system
Source (PyPI): 1 packages found for fast-bencode >=1.1.4,<2.0.0

Package operations: 1 install, 0 updates, 0 removals

  • Installing fast-bencode (1.1.4): Pending...
Skipping wheel fast_bencode-1.1.4-cp310-cp310-macosx_11_0_x86_64.whl as this is not supported by the current environment
Skipping wheel fast_bencode-1.1.4-cp310-cp310-manylinux2014_x86_64.whl as this is not supported by the current environment
Skipping wheel fast_bencode-1.1.4-cp310-cp310-win_amd64.whl as this is not supported by the current environment
Skipping wheel fast_bencode-1.1.4-cp311-cp311-macosx_10_9_universal2.whl as this is not supported by the current environment
Skipping wheel fast_bencode-1.1.4-cp311-cp311-manylinux2014_x86_64.whl as this is not supported by the current environment
Skipping wheel fast_bencode-1.1.4-cp311-cp311-win_amd64.whl as this is not supported by the current environment
Skipping wheel fast_bencode-1.1.4-cp312-cp312-macosx_10_9_universal2.whl as this is not supported by the current environment
Skipping wheel fast_bencode-1.1.4-cp312-cp312-manylinux2014_x86_64.whl as this is not supported by the current environment
Skipping wheel fast_bencode-1.1.4-cp312-cp312-win_amd64.whl as this is not supported by the current environment
Skipping wheel fast_bencode-1.1.4-cp36-cp36m-macosx_10_14_x86_64.whl as this is not supported by the current environment
Skipping wheel fast_bencode-1.1.4-cp36-cp36m-win_amd64.whl as this is not supported by the current environment
Skipping wheel fast_bencode-1.1.4-cp37-cp37m-macosx_11_0_x86_64.whl as this is not supported by the current environment
Skipping wheel fast_bencode-1.1.4-cp37-cp37m-manylinux2014_x86_64.whl as this is not supported by the current environment
Skipping wheel fast_bencode-1.1.4-cp37-cp37m-win_amd64.whl as this is not supported by the current environment
Skipping wheel fast_bencode-1.1.4-cp38-cp38-macosx_11_0_x86_64.whl as this is not supported by the current environment
Skipping wheel fast_bencode-1.1.4-cp38-cp38-manylinux2014_x86_64.whl as this is not supported by the current environment
Skipping wheel fast_bencode-1.1.4-cp38-cp38-win_amd64.whl as this is not supported by the current environment
Skipping wheel fast_bencode-1.1.4-cp39-cp39-macosx_11_0_x86_64.whl as this is not supported by the current environment
Skipping wheel fast_bencode-1.1.4-cp39-cp39-manylinux2014_x86_64.whl as this is not supported by the current environment
Skipping wheel fast_bencode-1.1.4-cp39-cp39-win_amd64.whl as this is not supported by the current environment
  • Installing fast-bencode (1.1.4): Preparing...
  • Installing fast-bencode (1.1.4): Failed

  Stack trace:

  8  ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/poetry/installation/executor.py:269 in _execute_operation
      267│
      268│             try:
    → 269│                 result = self._do_execute_operation(operation)
      270│             except EnvCommandError as e:
      271│                 if e.e.returncode == -2:

  7  ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/poetry/installation/executor.py:379 in _do_execute_operation
      377│             return 0
      378│
    → 379│         result: int = getattr(self, f"_execute_{method}")(operation)
      380│
      381│         if result != 0:

  6  ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/poetry/installation/executor.py:504 in _execute_install
      502│
      503│     def _execute_install(self, operation: Install | Update) -> int:
    → 504│         status_code = self._install(operation)
      505│
      506│         self._save_url_reference(operation)

  5  ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/poetry/installation/executor.py:542 in _install
      540│             archive = self._download_link(operation, Link(package.source_url))
      541│         else:
    → 542│             archive = self._download(operation)
      543│
      544│         operation_message = self.get_operation_message(operation)

  4  ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/poetry/installation/executor.py:746 in _download
      744│             self._yanked_warnings.append(message)
      745│
    → 746│         return self._download_link(operation, link)
      747│
      748│     def _download_link(self, operation: Install | Update, link: Link) -> Path:

  3  ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/poetry/installation/executor.py:781 in _download_link
      779│             self._write(operation, message)
      780│
    → 781│             archive = self._chef.prepare(archive, output_dir=original_archive.parent)
      782│
      783│         # Use the original archive to provide the correct hash.

  2  ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/poetry/installation/chef.py:123 in prepare
      121│             return self._prepare(archive, destination=destination, editable=editable)
      122│
    → 123│         return self._prepare_sdist(archive, destination=output_dir)
      124│
      125│     def _prepare(

  1  ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/poetry/installation/chef.py:194 in _prepare_sdist
      192│             destination.mkdir(parents=True, exist_ok=True)
      193│
    → 194│             return self._prepare(
      195│                 sdist_dir,
      196│                 destination,

  ChefBuildError

  Backend subprocess exited when trying to invoke get_requires_for_build_wheel

  Traceback (most recent call last):
    File "/home/ubuntu/.local/share/pypoetry/venv/lib/python3.10/site-packages/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
      main()
    File "/home/ubuntu/.local/share/pypoetry/venv/lib/python3.10/site-packages/pyproject_hooks/_in_process/_in_process.py", line 335, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "/home/ubuntu/.local/share/pypoetry/venv/lib/python3.10/site-packages/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
      return hook(config_settings)
    File "/tmp/tmpv7s3cr8s/.venv/lib/python3.10/site-packages/setuptools/build_meta.py", line 355, in get_requires_for_build_wheel
      return self._get_build_requires(config_settings, requirements=['wheel'])
    File "/tmp/tmpv7s3cr8s/.venv/lib/python3.10/site-packages/setuptools/build_meta.py", line 325, in _get_build_requires
      self.run_setup()
    File "/tmp/tmpv7s3cr8s/.venv/lib/python3.10/site-packages/setuptools/build_meta.py", line 507, in run_setup
      super(_BuildMetaLegacyBackend, self).run_setup(setup_script=setup_script)
    File "/tmp/tmpv7s3cr8s/.venv/lib/python3.10/site-packages/setuptools/build_meta.py", line 341, in run_setup
      exec(code, locals())
    File "<string>", line 44, in <module>
    File "/tmp/tmpv7s3cr8s/.venv/lib/python3.10/site-packages/setuptools/__init__.py", line 103, in setup
      return distutils.core.setup(**attrs)
    File "/tmp/tmpv7s3cr8s/.venv/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 172, in setup
      ok = dist.parse_command_line()
    File "/tmp/tmpv7s3cr8s/.venv/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 475, in parse_command_line
      args = self._parse_command_opts(parser, args)
    File "/tmp/tmpv7s3cr8s/.venv/lib/python3.10/site-packages/setuptools/dist.py", line 889, in _parse_command_opts
      nargs = _Distribution._parse_command_opts(self, parser, args)
    File "/tmp/tmpv7s3cr8s/.venv/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 534, in _parse_command_opts
      cmd_class = self.get_command_class(command)
    File "/tmp/tmpv7s3cr8s/.venv/lib/python3.10/site-packages/setuptools/dist.py", line 731, in get_command_class
      if command in self.cmdclass:
  TypeError: argument of type 'NoneType' is not iterable


  at ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/poetry/installation/chef.py:164 in _prepare
      160│
      161│                 error = ChefBuildError("\n\n".join(message_parts))
      162│
      163│             if error is not None:
    → 164│                 raise error from None
      165│
      166│             return path
      167│
      168│     def _prepare_sdist(self, archive: Path, destination: Path | None = None) -> Path:

Note: This error originates from the build backend, and is likely not a problem with poetry but with fast-bencode (1.1.4) not supporting PEP 517 builds. You can verify this by running 'pip wheel --no-cache-dir --use-pep517 "fast-bencode (==1.1.4)"'.

Here's the pip version:

(poetry-test-py3.10) $ pip install fast-bencode
Collecting fast-bencode
  Using cached fast_bencode-1.1.4-cp310-cp310-linux_aarch64.whl
Installing collected packages: fast-bencode
Successfully installed fast-bencode-1.1.4
@canine-afficionado canine-afficionado added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Nov 13, 2023
@dimbleby
Copy link
Contributor

Read the error message. This is not a poetry bug. Please close.

@canine-afficionado
Copy link
Author

Certainly did read the error message @dimbleby and running the test fails but why does it work with poetry on other platforms?

@dimbleby
Copy link
Contributor

Read the logs. - poetry is telling you that none of the fast-bencode wheel distributions are suitable for this platform.

You will need to take this up with fast-bencode: either to publish a wheel that works for you or to fix their source distribution.

@canine-afficionado
Copy link
Author

Thanks @dimbleby I suspected this might be the case from the logs but then when I installed with pip it did install a suitable wheel (as you can see above) which then confused me. Would it be something to do with PEP 517?

@dimbleby
Copy link
Contributor

are you sure you read the error message?

Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 29, 2024
@abn abn removed the status/triage This issue needs to be triaged label Mar 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Something isn't working as expected
Projects
None yet
Development

No branches or pull requests

3 participants