aahnik / tgcf

The ultimate tool to automate custom telegram message forwarding. Live-syncer, Auto-poster, backup-bot, cloner, chat-forwarder, duplicator, ... Call it whatever you like! tgcf can fulfill your custom needs.
https://github.com/aahnik/tgcf/wiki
MIT License
1.29k stars 773 forks source link

Not working with python 3.12 #599

Open superbonaci opened 1 month ago

superbonaci commented 1 month ago

I follow the instructions:

$ mkdir my-tgcf
$ cd my-tgcf
$ python3 -m venv .venv
$ source .venv/bin/activate
$ pip install tgcf
Collecting tgcf
  Using cached tgcf-1.1.8-py3-none-any.whl.metadata (6.6 kB)
Collecting Pillow<10.0.0,>=9.3.0 (from tgcf)
  Using cached Pillow-9.5.0-cp312-cp312-macosx_10_9_universal2.whl
Collecting PyYAML<7.0,>=6.0 (from tgcf)
  Using cached PyYAML-6.0.1-cp312-cp312-macosx_11_0_arm64.whl.metadata (2.1 kB)
Collecting Telethon==1.26.0 (from tgcf)
  Using cached Telethon-1.26.0-py3-none-any.whl.metadata (3.2 kB)
Collecting aiohttp<4.0.0,>=3.8.3 (from tgcf)
  Using cached aiohttp-3.9.5-cp312-cp312-macosx_11_0_arm64.whl.metadata (7.5 kB)
Collecting cryptg<0.5.0,>=0.4.0 (from tgcf)
  Using cached cryptg-0.4.0-cp312-cp312-macosx_11_0_arm64.whl.metadata (1.4 kB)
Collecting hachoir<4.0.0,>=3.1.3 (from tgcf)
  Using cached hachoir-3.3.0-py3-none-any.whl.metadata (2.9 kB)
Collecting pydantic<2.0.0,>=1.10.2 (from tgcf)
  Using cached pydantic-1.10.15-py3-none-any.whl.metadata (150 kB)
Collecting pymongo<5.0.0,>=4.3.3 (from tgcf)
  Using cached pymongo-4.7.2-cp312-cp312-macosx_11_0_arm64.whl.metadata (22 kB)
Collecting pytesseract<0.4.0,>=0.3.7 (from tgcf)
  Using cached pytesseract-0.3.10-py3-none-any.whl.metadata (11 kB)
Collecting python-dotenv<0.22.0,>=0.21.0 (from tgcf)
  Using cached python_dotenv-0.21.1-py3-none-any.whl.metadata (21 kB)
Collecting requests<3.0.0,>=2.28.1 (from tgcf)
  Using cached requests-2.32.2-py3-none-any.whl.metadata (4.6 kB)
Collecting rich<13.0.0,>=12.6.0 (from tgcf)
  Using cached rich-12.6.0-py3-none-any.whl.metadata (18 kB)
Collecting streamlit<2.0.0,>=1.15.2 (from tgcf)
  Using cached streamlit-1.34.0-py2.py3-none-any.whl.metadata (8.5 kB)
Collecting tg-login<0.0.5,>=0.0.4 (from tgcf)
  Using cached tg_login-0.0.4-py3-none-any.whl.metadata (1.6 kB)
Collecting typer<0.8.0,>=0.7.0 (from tgcf)
  Using cached typer-0.7.0-py3-none-any.whl.metadata (17 kB)
Collecting verlat<0.2.0,>=0.1.0 (from tgcf)
  Using cached verlat-0.1.0.post1-py3-none-any.whl.metadata (1.6 kB)
Collecting watermark.py<0.0.4,>=0.0.3 (from tgcf)
  Using cached watermark.py-0.0.3.post3-py3-none-any.whl.metadata (1.6 kB)
Collecting pyaes (from Telethon==1.26.0->tgcf)
  Using cached pyaes-1.6.1-py3-none-any.whl
Collecting rsa (from Telethon==1.26.0->tgcf)
  Using cached rsa-4.9-py3-none-any.whl.metadata (4.2 kB)
Collecting aiosignal>=1.1.2 (from aiohttp<4.0.0,>=3.8.3->tgcf)
  Using cached aiosignal-1.3.1-py3-none-any.whl.metadata (4.0 kB)
Collecting attrs>=17.3.0 (from aiohttp<4.0.0,>=3.8.3->tgcf)
  Using cached attrs-23.2.0-py3-none-any.whl.metadata (9.5 kB)
Collecting frozenlist>=1.1.1 (from aiohttp<4.0.0,>=3.8.3->tgcf)
  Using cached frozenlist-1.4.1-cp312-cp312-macosx_11_0_arm64.whl.metadata (12 kB)
Collecting multidict<7.0,>=4.5 (from aiohttp<4.0.0,>=3.8.3->tgcf)
  Using cached multidict-6.0.5-cp312-cp312-macosx_11_0_arm64.whl.metadata (4.2 kB)
Collecting yarl<2.0,>=1.0 (from aiohttp<4.0.0,>=3.8.3->tgcf)
  Using cached yarl-1.9.4-cp312-cp312-macosx_11_0_arm64.whl.metadata (31 kB)
Collecting typing-extensions>=4.2.0 (from pydantic<2.0.0,>=1.10.2->tgcf)
  Using cached typing_extensions-4.11.0-py3-none-any.whl.metadata (3.0 kB)
Collecting dnspython<3.0.0,>=1.16.0 (from pymongo<5.0.0,>=4.3.3->tgcf)
  Using cached dnspython-2.6.1-py3-none-any.whl.metadata (5.8 kB)
Collecting packaging>=21.3 (from pytesseract<0.4.0,>=0.3.7->tgcf)
  Using cached packaging-24.0-py3-none-any.whl.metadata (3.2 kB)
Collecting charset-normalizer<4,>=2 (from requests<3.0.0,>=2.28.1->tgcf)
  Using cached charset_normalizer-3.3.2-cp312-cp312-macosx_11_0_arm64.whl.metadata (33 kB)
Collecting idna<4,>=2.5 (from requests<3.0.0,>=2.28.1->tgcf)
  Using cached idna-3.7-py3-none-any.whl.metadata (9.9 kB)
Collecting urllib3<3,>=1.21.1 (from requests<3.0.0,>=2.28.1->tgcf)
  Using cached urllib3-2.2.1-py3-none-any.whl.metadata (6.4 kB)
Collecting certifi>=2017.4.17 (from requests<3.0.0,>=2.28.1->tgcf)
  Using cached certifi-2024.2.2-py3-none-any.whl.metadata (2.2 kB)
Collecting commonmark<0.10.0,>=0.9.0 (from rich<13.0.0,>=12.6.0->tgcf)
  Using cached commonmark-0.9.1-py2.py3-none-any.whl.metadata (5.7 kB)
Collecting pygments<3.0.0,>=2.6.0 (from rich<13.0.0,>=12.6.0->tgcf)
  Using cached pygments-2.18.0-py3-none-any.whl.metadata (2.5 kB)
Collecting altair<6,>=4.0 (from streamlit<2.0.0,>=1.15.2->tgcf)
  Using cached altair-5.3.0-py3-none-any.whl.metadata (9.2 kB)
Collecting blinker<2,>=1.0.0 (from streamlit<2.0.0,>=1.15.2->tgcf)
  Using cached blinker-1.8.2-py3-none-any.whl.metadata (1.6 kB)
Collecting cachetools<6,>=4.0 (from streamlit<2.0.0,>=1.15.2->tgcf)
  Using cached cachetools-5.3.3-py3-none-any.whl.metadata (5.3 kB)
Collecting click<9,>=7.0 (from streamlit<2.0.0,>=1.15.2->tgcf)
  Using cached click-8.1.7-py3-none-any.whl.metadata (3.0 kB)
Collecting numpy<2,>=1.19.3 (from streamlit<2.0.0,>=1.15.2->tgcf)
  Using cached numpy-1.26.4-cp312-cp312-macosx_11_0_arm64.whl.metadata (61 kB)
Collecting pandas<3,>=1.3.0 (from streamlit<2.0.0,>=1.15.2->tgcf)
  Using cached pandas-2.2.2-cp312-cp312-macosx_11_0_arm64.whl.metadata (19 kB)
Collecting protobuf<5,>=3.20 (from streamlit<2.0.0,>=1.15.2->tgcf)
  Using cached protobuf-4.25.3-cp37-abi3-macosx_10_9_universal2.whl.metadata (541 bytes)
Collecting pyarrow>=7.0 (from streamlit<2.0.0,>=1.15.2->tgcf)
  Using cached pyarrow-16.1.0-cp312-cp312-macosx_11_0_arm64.whl.metadata (3.0 kB)
Collecting tenacity<9,>=8.1.0 (from streamlit<2.0.0,>=1.15.2->tgcf)
  Using cached tenacity-8.3.0-py3-none-any.whl.metadata (1.2 kB)
Collecting toml<2,>=0.10.1 (from streamlit<2.0.0,>=1.15.2->tgcf)
  Using cached toml-0.10.2-py2.py3-none-any.whl.metadata (7.1 kB)
Collecting gitpython!=3.1.19,<4,>=3.0.7 (from streamlit<2.0.0,>=1.15.2->tgcf)
  Using cached GitPython-3.1.43-py3-none-any.whl.metadata (13 kB)
Collecting pydeck<1,>=0.8.0b4 (from streamlit<2.0.0,>=1.15.2->tgcf)
  Using cached pydeck-0.9.1-py2.py3-none-any.whl.metadata (4.1 kB)
Collecting tornado<7,>=6.0.3 (from streamlit<2.0.0,>=1.15.2->tgcf)
  Using cached tornado-6.4-cp38-abi3-macosx_10_9_universal2.whl.metadata (2.5 kB)
Collecting jinja2 (from altair<6,>=4.0->streamlit<2.0.0,>=1.15.2->tgcf)
  Using cached jinja2-3.1.4-py3-none-any.whl.metadata (2.6 kB)
Collecting jsonschema>=3.0 (from altair<6,>=4.0->streamlit<2.0.0,>=1.15.2->tgcf)
  Using cached jsonschema-4.22.0-py3-none-any.whl.metadata (8.2 kB)
Collecting toolz (from altair<6,>=4.0->streamlit<2.0.0,>=1.15.2->tgcf)
  Using cached toolz-0.12.1-py3-none-any.whl.metadata (5.1 kB)
Collecting gitdb<5,>=4.0.1 (from gitpython!=3.1.19,<4,>=3.0.7->streamlit<2.0.0,>=1.15.2->tgcf)
  Using cached gitdb-4.0.11-py3-none-any.whl.metadata (1.2 kB)
Collecting python-dateutil>=2.8.2 (from pandas<3,>=1.3.0->streamlit<2.0.0,>=1.15.2->tgcf)
  Using cached python_dateutil-2.9.0.post0-py2.py3-none-any.whl.metadata (8.4 kB)
Collecting pytz>=2020.1 (from pandas<3,>=1.3.0->streamlit<2.0.0,>=1.15.2->tgcf)
  Using cached pytz-2024.1-py2.py3-none-any.whl.metadata (22 kB)
Collecting tzdata>=2022.7 (from pandas<3,>=1.3.0->streamlit<2.0.0,>=1.15.2->tgcf)
  Using cached tzdata-2024.1-py2.py3-none-any.whl.metadata (1.4 kB)
Collecting pyasn1>=0.1.3 (from rsa->Telethon==1.26.0->tgcf)
  Using cached pyasn1-0.6.0-py2.py3-none-any.whl.metadata (8.3 kB)
Collecting smmap<6,>=3.0.1 (from gitdb<5,>=4.0.1->gitpython!=3.1.19,<4,>=3.0.7->streamlit<2.0.0,>=1.15.2->tgcf)
  Using cached smmap-5.0.1-py3-none-any.whl.metadata (4.3 kB)
Collecting MarkupSafe>=2.0 (from jinja2->altair<6,>=4.0->streamlit<2.0.0,>=1.15.2->tgcf)
  Using cached MarkupSafe-2.1.5-cp312-cp312-macosx_10_9_universal2.whl.metadata (3.0 kB)
Collecting jsonschema-specifications>=2023.03.6 (from jsonschema>=3.0->altair<6,>=4.0->streamlit<2.0.0,>=1.15.2->tgcf)
  Using cached jsonschema_specifications-2023.12.1-py3-none-any.whl.metadata (3.0 kB)
Collecting referencing>=0.28.4 (from jsonschema>=3.0->altair<6,>=4.0->streamlit<2.0.0,>=1.15.2->tgcf)
  Using cached referencing-0.35.1-py3-none-any.whl.metadata (2.8 kB)
Collecting rpds-py>=0.7.1 (from jsonschema>=3.0->altair<6,>=4.0->streamlit<2.0.0,>=1.15.2->tgcf)
  Using cached rpds_py-0.18.1-cp312-cp312-macosx_11_0_arm64.whl.metadata (4.1 kB)
Collecting six>=1.5 (from python-dateutil>=2.8.2->pandas<3,>=1.3.0->streamlit<2.0.0,>=1.15.2->tgcf)
  Using cached six-1.16.0-py2.py3-none-any.whl.metadata (1.8 kB)
Using cached tgcf-1.1.8-py3-none-any.whl (31 kB)
Using cached Telethon-1.26.0-py3-none-any.whl (584 kB)
Using cached aiohttp-3.9.5-cp312-cp312-macosx_11_0_arm64.whl (392 kB)
Using cached cryptg-0.4.0-cp312-cp312-macosx_11_0_arm64.whl (249 kB)
Using cached hachoir-3.3.0-py3-none-any.whl (650 kB)
Using cached pydantic-1.10.15-py3-none-any.whl (159 kB)
Using cached pymongo-4.7.2-cp312-cp312-macosx_11_0_arm64.whl (486 kB)
Using cached pytesseract-0.3.10-py3-none-any.whl (14 kB)
Using cached python_dotenv-0.21.1-py3-none-any.whl (19 kB)
Using cached PyYAML-6.0.1-cp312-cp312-macosx_11_0_arm64.whl (165 kB)
Using cached requests-2.32.2-py3-none-any.whl (63 kB)
Using cached rich-12.6.0-py3-none-any.whl (237 kB)
Using cached streamlit-1.34.0-py2.py3-none-any.whl (8.5 MB)
Using cached tg_login-0.0.4-py3-none-any.whl (4.5 kB)
Using cached typer-0.7.0-py3-none-any.whl (38 kB)
Using cached verlat-0.1.0.post1-py3-none-any.whl (3.1 kB)
Using cached watermark.py-0.0.3.post3-py3-none-any.whl (3.3 kB)
Using cached aiosignal-1.3.1-py3-none-any.whl (7.6 kB)
Using cached altair-5.3.0-py3-none-any.whl (857 kB)
Using cached attrs-23.2.0-py3-none-any.whl (60 kB)
Using cached blinker-1.8.2-py3-none-any.whl (9.5 kB)
Using cached cachetools-5.3.3-py3-none-any.whl (9.3 kB)
Using cached certifi-2024.2.2-py3-none-any.whl (163 kB)
Using cached charset_normalizer-3.3.2-cp312-cp312-macosx_11_0_arm64.whl (119 kB)
Using cached click-8.1.7-py3-none-any.whl (97 kB)
Using cached commonmark-0.9.1-py2.py3-none-any.whl (51 kB)
Using cached dnspython-2.6.1-py3-none-any.whl (307 kB)
Using cached frozenlist-1.4.1-cp312-cp312-macosx_11_0_arm64.whl (51 kB)
Using cached GitPython-3.1.43-py3-none-any.whl (207 kB)
Using cached idna-3.7-py3-none-any.whl (66 kB)
Using cached multidict-6.0.5-cp312-cp312-macosx_11_0_arm64.whl (29 kB)
Using cached numpy-1.26.4-cp312-cp312-macosx_11_0_arm64.whl (13.7 MB)
Using cached packaging-24.0-py3-none-any.whl (53 kB)
Using cached pandas-2.2.2-cp312-cp312-macosx_11_0_arm64.whl (11.3 MB)
Using cached protobuf-4.25.3-cp37-abi3-macosx_10_9_universal2.whl (394 kB)
Using cached pyarrow-16.1.0-cp312-cp312-macosx_11_0_arm64.whl (26.0 MB)
Using cached pydeck-0.9.1-py2.py3-none-any.whl (6.9 MB)
Using cached pygments-2.18.0-py3-none-any.whl (1.2 MB)
Using cached tenacity-8.3.0-py3-none-any.whl (25 kB)
Using cached toml-0.10.2-py2.py3-none-any.whl (16 kB)
Using cached tornado-6.4-cp38-abi3-macosx_10_9_universal2.whl (433 kB)
Using cached typing_extensions-4.11.0-py3-none-any.whl (34 kB)
Using cached urllib3-2.2.1-py3-none-any.whl (121 kB)
Using cached yarl-1.9.4-cp312-cp312-macosx_11_0_arm64.whl (79 kB)
Using cached rsa-4.9-py3-none-any.whl (34 kB)
Using cached gitdb-4.0.11-py3-none-any.whl (62 kB)
Using cached jinja2-3.1.4-py3-none-any.whl (133 kB)
Using cached jsonschema-4.22.0-py3-none-any.whl (88 kB)
Using cached pyasn1-0.6.0-py2.py3-none-any.whl (85 kB)
Using cached python_dateutil-2.9.0.post0-py2.py3-none-any.whl (229 kB)
Using cached pytz-2024.1-py2.py3-none-any.whl (505 kB)
Using cached tzdata-2024.1-py2.py3-none-any.whl (345 kB)
Using cached toolz-0.12.1-py3-none-any.whl (56 kB)
Using cached jsonschema_specifications-2023.12.1-py3-none-any.whl (18 kB)
Using cached MarkupSafe-2.1.5-cp312-cp312-macosx_10_9_universal2.whl (18 kB)
Using cached referencing-0.35.1-py3-none-any.whl (26 kB)
Using cached rpds_py-0.18.1-cp312-cp312-macosx_11_0_arm64.whl (323 kB)
Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
Using cached smmap-5.0.1-py3-none-any.whl (24 kB)
Installing collected packages: pytz, pyaes, hachoir, commonmark, watermark.py, urllib3, tzdata, typing-extensions, tornado, toolz, toml, tenacity, smmap, six, rpds-py, PyYAML, python-dotenv, pygments, pyasn1, protobuf, Pillow, packaging, numpy, multidict, MarkupSafe, idna, frozenlist, dnspython, cryptg, click, charset-normalizer, certifi, cachetools, blinker, attrs, yarl, typer, rsa, rich, requests, referencing, python-dateutil, pytesseract, pymongo, pydantic, pyarrow, jinja2, gitdb, aiosignal, verlat, Telethon, pydeck, pandas, jsonschema-specifications, gitpython, aiohttp, tg-login, jsonschema, altair, streamlit, tgcf
Successfully installed MarkupSafe-2.1.5 Pillow-9.5.0 PyYAML-6.0.1 Telethon-1.26.0 aiohttp-3.9.5 aiosignal-1.3.1 altair-5.3.0 attrs-23.2.0 blinker-1.8.2 cachetools-5.3.3 certifi-2024.2.2 charset-normalizer-3.3.2 click-8.1.7 commonmark-0.9.1 cryptg-0.4.0 dnspython-2.6.1 frozenlist-1.4.1 gitdb-4.0.11 gitpython-3.1.43 hachoir-3.3.0 idna-3.7 jinja2-3.1.4 jsonschema-4.22.0 jsonschema-specifications-2023.12.1 multidict-6.0.5 numpy-1.26.4 packaging-24.0 pandas-2.2.2 protobuf-4.25.3 pyaes-1.6.1 pyarrow-16.1.0 pyasn1-0.6.0 pydantic-1.10.15 pydeck-0.9.1 pygments-2.18.0 pymongo-4.7.2 pytesseract-0.3.10 python-dateutil-2.9.0.post0 python-dotenv-0.21.1 pytz-2024.1 referencing-0.35.1 requests-2.32.2 rich-12.6.0 rpds-py-0.18.1 rsa-4.9 six-1.16.0 smmap-5.0.1 streamlit-1.34.0 tenacity-8.3.0 tg-login-0.0.4 tgcf-1.1.8 toml-0.10.2 toolz-0.12.1 tornado-6.4 typer-0.7.0 typing-extensions-4.11.0 tzdata-2024.1 urllib3-2.2.1 verlat-0.1.0.post1 watermark.py-0.0.3.post3 yarl-1.9.4
$ tgcf-web
Traceback (most recent call last):
  File "/Users/aahnik/my-tgcf/.venv/bin/tgcf-web", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/Users/aahnik/my-tgcf/.venv/lib/python3.12/site-packages/tgcf/web_ui/run.py", line 8, in main
    package_dir = resources.path(package=wu, resource="").__enter__()
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/python@3.12/3.12.3/Frameworks/Python.framework/Versions/3.12/lib/python3.12/importlib/resources/_legacy.py", line 25, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/python@3.12/3.12.3/Frameworks/Python.framework/Versions/3.12/lib/python3.12/importlib/resources/_legacy.py", line 120, in path
    return _common.as_file(_common.files(package) / normalize_path(resource))
                           ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
  File "/opt/homebrew/Cellar/python@3.12/3.12.3/Frameworks/Python.framework/Versions/3.12/lib/python3.12/importlib/resources/abc.py", line 133, in __truediv__
    return self.joinpath(child)
           ^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/python@3.12/3.12.3/Frameworks/Python.framework/Versions/3.12/lib/python3.12/importlib/resources/readers.py", line 92, in joinpath
    return super().joinpath(*descendants)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/python@3.12/3.12.3/Frameworks/Python.framework/Versions/3.12/lib/python3.12/importlib/resources/abc.py", line 117, in joinpath
    target = next(names)
             ^^^^^^^^^^^
StopIteration
superbonaci commented 1 month ago

Same thing with pipx:

$ pipx install tgcf
  installed package tgcf 1.1.8, installed using Python 3.12.3
  These apps are now globally available
    - tgcf
    - tgcf-web
done! ✨ 🌟 ✨
$ tgcf-web
Traceback (most recent call last):
  File "/Users/aahnik/.local/bin/tgcf-web", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/Users/aahnik/.local/pipx/venvs/tgcf/lib/python3.12/site-packages/tgcf/web_ui/run.py", line 8, in main
    package_dir = resources.path(package=wu, resource="").__enter__()
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/python@3.12/3.12.3/Frameworks/Python.framework/Versions/3.12/lib/python3.12/importlib/resources/_legacy.py", line 25, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/python@3.12/3.12.3/Frameworks/Python.framework/Versions/3.12/lib/python3.12/importlib/resources/_legacy.py", line 120, in path
    return _common.as_file(_common.files(package) / normalize_path(resource))
                           ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
  File "/opt/homebrew/Cellar/python@3.12/3.12.3/Frameworks/Python.framework/Versions/3.12/lib/python3.12/importlib/resources/abc.py", line 133, in __truediv__
    return self.joinpath(child)
           ^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/python@3.12/3.12.3/Frameworks/Python.framework/Versions/3.12/lib/python3.12/importlib/resources/readers.py", line 92, in joinpath
    return super().joinpath(*descendants)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/python@3.12/3.12.3/Frameworks/Python.framework/Versions/3.12/lib/python3.12/importlib/resources/abc.py", line 117, in joinpath
    target = next(names)
             ^^^^^^^^^^^
StopIteration