AttributeError: module 'pkgutil' has no attribute 'ImpImporter' при загрузке телеграм бота на Heroku
При деплое телеграм бота на Heroku вознкает ошбка
-----> Building on the Heroku-22 stack
-----> Determining which buildpack to use for this app
-----> Python app detected
-----> No Python version was specified. Using the buildpack default: python-3.12.1
To use a different version, see: https://devcenter.heroku.com/articles/python-runtimes
-----> Installing python-3.12.1
-----> Installing pip 23.3.2, setuptools 68.2.2 and wheel 0.42.0
-----> Installing SQLite3
-----> Installing requirements with pip
Collecting aiocron==1.8 (from -r requirements.txt (line 1))
Downloading aiocron-1.8-py3-none-any.whl (4.8 kB)
Collecting aiogram==2.25.1 (from -r requirements.txt (line 2))
Downloading aiogram-2.25.1-py3-none-any.whl (203 kB)
Collecting aiohttp==3.8.4 (from -r requirements.txt (line 3))
Downloading aiohttp-3.8.4.tar.gz (7.3 MB)
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'done'
Installing backend dependencies: started
Installing backend dependencies: finished with status 'done'
Preparing metadata (pyproject.toml): started
Preparing metadata (pyproject.toml): finished with status 'done'
Collecting aiosignal==1.3.1 (from -r requirements.txt (line 4))
Downloading aiosignal-1.3.1-py3-none-any.whl (7.6 kB)
Collecting async-timeout==4.0.2 (from -r requirements.txt (line 5))
Downloading async_timeout-4.0.2-py3-none-any.whl (5.8 kB)
Collecting attrs==23.1.0 (from -r requirements.txt (line 6))
Downloading attrs-23.1.0-py3-none-any.whl (61 kB)
Collecting Babel==2.9.1 (from -r requirements.txt (line 7))
Downloading Babel-2.9.1-py2.py3-none-any.whl (8.8 MB)
Collecting cachetools==5.3.1 (from -r requirements.txt (line 8))
Downloading cachetools-5.3.1-py3-none-any.whl.metadata (5.2 kB)
Collecting certifi==2023.5.7 (from -r requirements.txt (line 9))
Downloading certifi-2023.5.7-py3-none-any.whl (156 kB)
Collecting charset-normalizer==3.1.0 (from -r requirements.txt (line 10))
Downloading charset_normalizer-3.1.0-py3-none-any.whl (46 kB)
Collecting croniter==1.3.15 (from -r requirements.txt (line 11))
Downloading croniter-1.3.15-py2.py3-none-any.whl.metadata (23 kB)
Collecting distlib==0.3.8 (from -r requirements.txt (line 12))
Downloading distlib-0.3.8-py2.py3-none-any.whl.metadata (5.1 kB)
Collecting filelock==3.13.1 (from -r requirements.txt (line 13))
Downloading filelock-3.13.1-py3-none-any.whl.metadata (2.8 kB)
Collecting frozenlist==1.3.3 (from -r requirements.txt (line 14))
Downloading frozenlist-1.3.3.tar.gz (66 kB)
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'done'
Preparing metadata (pyproject.toml): started
Preparing metadata (pyproject.toml): finished with status 'done'
Collecting google-auth==2.19.0 (from -r requirements.txt (line 15))
Downloading google_auth-2.19.0-py2.py3-none-any.whl.metadata (4.2 kB)
Collecting google-auth-oauthlib==1.0.0 (from -r requirements.txt (line 16))
Downloading google_auth_oauthlib-1.0.0-py2.py3-none-any.whl (18 kB)
Collecting gspread==5.9.0 (from -r requirements.txt (line 17))
Downloading gspread-5.9.0-py3-none-any.whl (40 kB)
Collecting httplib2==0.22.0 (from -r requirements.txt (line 18))
Downloading httplib2-0.22.0-py3-none-any.whl (96 kB)
Collecting idna==3.4 (from -r requirements.txt (line 19))
Downloading idna-3.4-py3-none-any.whl (61 kB)
Collecting magic-filter==1.0.9 (from -r requirements.txt (line 20))
Downloading magic_filter-1.0.9-py3-none-any.whl (9.3 kB)
Collecting multidict==6.0.4 (from -r requirements.txt (line 21))
Downloading multidict-6.0.4.tar.gz (51 kB)
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'done'
Installing backend dependencies: started
Installing backend dependencies: finished with status 'done'
Preparing metadata (pyproject.toml): started
Preparing metadata (pyproject.toml): finished with status 'done'
Collecting numpy==1.25.0 (from -r requirements.txt (line 22))
Downloading numpy-1.25.0.tar.gz (10.4 MB)
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'error'
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> [33 lines of output]
Traceback (most recent call last):
File "/app/.heroku/python/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
main()
File "/app/.heroku/python/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/.heroku/python/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 112, in get_requires_for_build_wheel
backend = _build_backend()
^^^^^^^^^^^^^^^^
File "/app/.heroku/python/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 77, in _build_backend
obj = import_module(mod_path)
^^^^^^^^^^^^^^^^^^^^^^^
File "/app/.heroku/python/lib/python3.12/importlib/__init__.py", line 90, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
File "<frozen importlib._bootstrap>", line 1310, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 994, in exec_module
File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
File "/tmp/pip-build-env-pxz6s_po/overlay/lib/python3.12/site-packages/setuptools/__init__.py", line 16, in <module>
import setuptools.version
File "/tmp/pip-build-env-pxz6s_po/overlay/lib/python3.12/site-packages/setuptools/version.py", line 1, in <module>
import pkg_resources
File "/tmp/pip-build-env-pxz6s_po/overlay/lib/python3.12/site-packages/pkg_resources/__init__.py", line 2172, in <module>
register_finder(pkgutil.ImpImporter, find_on_path)
^^^^^^^^^^^^^^^^^^^
AttributeError: module 'pkgutil' has no attribute 'ImpImporter'. Did you mean: 'zipimporter'?
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
! Push rejected, failed to compile Python app.
! Push failed