I bought MacBook Air on m1 and downloaded PyCharm for work. When I try run my project on aiogram, it does not work. It gives this traceback:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/aiohttp/client_reqrep.py", line 70, in <module>
import cchardet as chardet
ModuleNotFoundError: No module named 'cchardet'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/danilapachev/Desktop/projects/06_07_bot_organization/bot.py", line 1, in <module>
from aiogram import Bot, Dispatcher, executor, types
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/aiogram/__init__.py", line 9, in <module>
from . import bot
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/aiogram/bot/__init__.py", line 1, in <module>
from . import api
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/aiogram/bot/api.py", line 6, in <module>
import aiohttp
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/aiohttp/__init__.py", line 6, in <module>
from .client import (
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/aiohttp/client.py", line 59, in <module>
from .client_reqrep import (
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/aiohttp/client_reqrep.py", line 72, in <module>
import charset_normalizer as chardet # type: ignore[no-redef]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/charset_normalizer/__init__.py", line 24, in <module>
from .api import from_bytes, from_fp, from_path, is_binary
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/charset_normalizer/api.py", line 5, in <module>
from .cd import (
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/charset_normalizer/cd.py", line 9, in <module>
from .md import is_suspiciously_successive_range
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/charset_normalizer/md.cpython-311-darwin.so, 0x0002): tried: '/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/charset_normalizer/md.cpython-311-darwin.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/charset_normalizer/md.cpython-311-darwin.so' (no such file), '/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/charset_normalizer/md.cpython-311-darwin.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64'))
I try this commands:
$ arch -arm64 brew install llvm
$ sudo gem install ffi
and try
pipx uninstall aiogram
pipx install aiogram