Skip to content

requests dep not updated on latest release - ImportError: cannot import name 'atomic_open' from 'requests.utils' #8338

Closed

Description

@gsingh1
  • Poetry version: Poetry (version 1.6.0)
  • Python version: 3.10.5
  • OS version and name: Ubuntu 22.04
  • pyproject.toml: n/a
  • 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

The latest https://github.com/python-poetry/poetry/releases/tag/1.6.0 uses a new version of requests that has the atomic_open function defined. However, this is not being pulled in when installing poetry using pip.

It seems that the requests package version has not been bumped ^2.26 where the function exists. The fix probably relates around bumping this dep's version so that folks will install the correct required dependencies.

I have also tried recreating this by installing poetry using the official installer script, however things work as expected so it must be pulling in the latest version of the dep somewhere.

/home/runner/.local/bin/poetry config --list
Traceback (most recent call last):
  File "/home/runner/.local/lib/python3.8/site-packages/cleo/application.py", line 327, in run
    exit_code = self._run(io)
  File "/home/runner/.local/lib/python3.8/site-packages/poetry/console/application.py", line 188, in _run
    self._load_plugins(io)
  File "/home/runner/.local/lib/python3.8/site-packages/poetry/console/application.py", line 354, in _load_plugins
    manager.load_plugins()
  File "/home/runner/.local/lib/python3.8/site-packages/poetry/plugins/plugin_manager.py", line 38, in load_plugins
    self._load_plugin_entry_point(ep)
  File "/home/runner/.local/lib/python3.8/site-packages/poetry/plugins/plugin_manager.py", line 76, in _load_plugin_entry_point
    plugin = ep.load()  # type: ignore[no-untyped-call]
  File "/home/runner/.local/lib/python3.8/site-packages/importlib_metadata/__init__.py", line 209, in load
    module = import_module(match.group('module'))
  File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 848, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/runner/.local/lib/python3.8/site-packages/poetry_plugin_export/plugins.py", line 7, in <module>
    from poetry_plugin_export.command import ExportCommand
  File "/home/runner/.local/lib/python3.8/site-packages/poetry_plugin_export/command.py", line 10, in <module>
    from poetry_plugin_export.exporter import Exporter
  File "/home/runner/.local/lib/python3.8/site-packages/poetry_plugin_export/exporter.py", line 11, in <module>
    from poetry.repositories.http_repository import HTTPRepository
  File "/home/runner/.local/lib/python3.8/site-packages/poetry/repositories/http_repository.py", line 27, in <module>
    from poetry.utils.helpers import download_file
  File "/home/runner/.local/lib/python3.8/site-packages/poetry/utils/helpers.py", line 17, in <module>
    from requests.utils import atomic_open
ImportError: cannot import name 'atomic_open' from 'requests.utils' (/usr/lib/python3/dist-packages/requests/utils.py)

Activity

  1. added
    kind/bugSomething isn't working as expected
    status/triageThis issue needs to be triaged
    on Aug 21, 2023
  2. added
    area/project/depsRelated to Poetry's own dependencies
    and removed
    status/triageThis issue needs to be triaged
    on Aug 21, 2023
  3. github-actions commented on Feb 29, 2024

    @github-actions

    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.

  4. locked as resolved and limited conversation to collaborators on Feb 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/project/depsRelated to Poetry's own dependencieskind/bugSomething isn't working as expected

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions