Skip to content

ImportError: cannot import name '_unicodefun' from 'click' #2976

Closed
freeorion/freeorion
#3846

Description

@enaskopelja

Describe the bug
A recent version of click has been released which removes _unicodefun, breaking black (see also dask/distributed#6013).

To Reproduce

docker run --rm -it python:3.9-alpine sh

In the container:

pip install "click==8.1.0" "black==22.1.0"
black .

The resulting error is:

Traceback (most recent call last):
  File "/usr/local/bin/black", line 8, in <module>
    sys.exit(patched_main())
  File "/usr/local/lib/python3.9/site-packages/black/__init__.py", line 1423, in patched_main
    patch_click()
  File "/usr/local/lib/python3.9/site-packages/black/__init__.py", line 1409, in patch_click
    from click import _unicodefun
ImportError: cannot import name '_unicodefun' from 'click' (/usr/local/lib/python3.9/site-packages/click/__init__.py)

Activity

  1. zerocewl commented on Mar 30, 2022

    @zerocewl

    maybe pin click to the version before as first workaround? click==8.0.2

    pip install --upgrade click==8.0.2

    see also dask/distributed#6013

  2. Jackenmen commented on Mar 30, 2022

    @Jackenmen
    Contributor

    This has been fixed by Black 22.3.0. Versions before that won't work with click 8.1.0.

  3. felix-hilden commented on Mar 30, 2022

    @felix-hilden
    Collaborator

    Correct, see issue #2964 for more info.

  4. added a commit that references this issue on Apr 6, 2022
  5. added a commit that references this issue on Apr 6, 2022
  6. 1 remaining item

  7. added a commit that references this issue on May 19, 2022
  8. added a commit that references this issue on Aug 18, 2022
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

    R: duplicateThis issue or pull request already existsT: bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions