Closed glenn-jocher closed 10 months ago
I can't reproduce the problem. This is likely any issue with your environment or pypi, but unlikely a docformatter issue.
I just ran into the same problem (I think).
I installed docformatter via pip into a conda environment using python 3.11 on an Ubuntu 20.4 LTS machine.
(orca_new) westentp@rpeuwprlc0013:~/projects/orca$ docformatter --help
Traceback (most recent call last):
File "/home/users/westentp/anaconda3/envs/orca_new/bin/docformatter", line 5, in <module>
from docformatter.__main__ import main
File "/home/users/westentp/anaconda3/envs/orca_new/lib/python3.11/site-packages/docformatter/__init__.py", line 36, in <module>
from .encode import Encoder # isort: skip # noqa F401
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/users/westentp/anaconda3/envs/orca_new/lib/python3.11/site-packages/docformatter/encode.py", line 33, in <module>
from charset_normalizer import from_path # pylint: disable=import-error
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/users/westentp/anaconda3/envs/orca_new/lib/python3.11/site-packages/charset_normalizer/__init__.py", line 23, in <module>
from charset_normalizer.api import from_fp, from_path, from_bytes, normalize
File "/home/users/westentp/anaconda3/envs/orca_new/lib/python3.11/site-packages/charset_normalizer/api.py", line 10, in <module>
from charset_normalizer.md import mess_ratio
File "charset_normalizer/md.py", line 5, in <module>
ImportError: cannot import name 'COMMON_SAFE_ASCII_CHARACTERS' from 'charset_normalizer.constant' (/home/users/westentp/anaconda3/envs/orca_new/lib/python3.11/site-packages/charset_normalizer/constant.py)
Update:
conda install -c conda-forge charset-normalizer
solved it for me as suggested here: https://stackoverflow.com/questions/74535380/importerror-cannot-import-name-common-safe-ascii-characters-from-charset-nor
Closing as I'm not longer receiving this error.
The issue seems related to a mismatch in the architecture of the compiled Python package and the architecture of your system. Your system is running on arm64, but the charset_normalizer package appears to have been compiled for x86_64.
Environment
Reproduce
Clone the https://github.com/ultralytics/ultralytics repo in PyCharm, run
pip install -e '.[dev]'
and then run push to your branch using PyCharm, and the error will appear.