ANTICHAT

ANTICHAT (https://forum.antichat.xyz/index.php)
-   Python (https://forum.antichat.xyz/forumdisplay.php?f=205)
-   -   Какая библеотека лучше для написаня тг бота в vs code на пайтон? (https://forum.antichat.xyz/showthread.php?t=1517643)

Fretsi_Rewy 03.08.2024 19:25

Какая библеотека лучше для написаня тг бота в vs code на пайтон?

chromiusj 03.08.2024 19:36

а разница(вскод,пайчарм)?

айограм юзай и норм

H39IAD 03.08.2024 19:38

python-telegram-bot

deadhuqe 03.08.2024 21:49

Цитата:

Сообщение от Fretsi_Rewy

Какая библеотека лучше для написаня тг бота в vs code на пайтон?

aiogram

Fretsi_Rewy 04.08.2024 00:30

Цитата:

Сообщение от chromiusj

а разница(вскод,пайчарм)?
айограм юзай и норм

File "C:\Users\Admin\Documents\Документи\Pytho n file\bot.py", line 3, in

from aiogram.utils import executor

ImportError: cannot import name 'executor' from 'aiogram.utils' (C:\Users\Admin\AppData\Local\Programs\Python\Pyth on312\Lib\site-packages\aiogram\utils\__init__.py)

PS C:\Users\Admin\Documents\Документи\Python file> & C:/Users/Admin/AppData/Local/Programs/Python/Python312/python.exe "c:/Users/Admin/Documents/окументи/Python file/bot.py"

C:\Users\Admin\AppData\Local\Programs\Python\Pytho n312\python.exe: can't open file 'c:\\Users\\Admin\\Documents\\окументи\\Py thon file\\bot.py': [Errno 2] No such file or directory

PS C:\Users\Admin\Documents\Документи\Python file>

Неподскажеш как исправить написал код для тг бота а в теринале отакое и хз как исправить

fokichevskiy 04.08.2024 00:43

Цитата:

Сообщение от Fretsi_Rewy

File "C:\Users\Admin\Documents\Документи\Pytho n file\bot.py", line 3, in
from aiogram.utils import executor
ImportError: cannot import name 'executor' from 'aiogram.utils' (C:\Users\Admin\AppData\Local\Programs\Python\Pyth on312\Lib\site-packages\aiogram\utils\__init__.py)
PS C:\Users\Admin\Documents\Документи\Python file> & C:/Users/Admin/AppData/Local/Programs/Python/Python312/python.exe "c:/Users/Admin/Documents/окументи/Python file/bot.py"
C:\Users\Admin\AppData\Local\Programs\Python\Pytho n312\python.exe: can't open file 'c:\\Users\\Admin\\Documents\\окументи\\Py thon file\\bot.py': [Errno 2] No such file or directory
PS C:\Users\Admin\Documents\Документи\Python file>
Неподскажеш как исправить написал код для тг бота а в теринале отакое и хз как исправить

в открытой тобой директории нету файла с ботом и с aiogram-ом че то не так

chromiusj 04.08.2024 01:16

Цитата:

Сообщение от Fretsi_Rewy

File "C:\Users\Admin\Documents\Документи\Pytho n file\bot.py", line 3, in
from aiogram.utils import executor
ImportError: cannot import name 'executor' from 'aiogram.utils' (C:\Users\Admin\AppData\Local\Programs\Python\Pyth on312\Lib\site-packages\aiogram\utils\__init__.py)
PS C:\Users\Admin\Documents\Документи\Python file> & C:/Users/Admin/AppData/Local/Programs/Python/Python312/python.exe "c:/Users/Admin/Documents/окументи/Python file/bot.py"
C:\Users\Admin\AppData\Local\Programs\Python\Pytho n312\python.exe: can't open file 'c:\\Users\\Admin\\Documents\\окументи\\Py thon file\\bot.py': [Errno 2] No such file or directory
PS C:\Users\Admin\Documents\Документи\Python file>
Неподскажеш как исправить написал код для тг бота а в теринале отакое и хз как исправить

покажи код

Fretsi_Rewy 04.08.2024 01:20

Цитата:

Сообщение от chromiusj

покажи код

Новая ошибка в терминале

PS C:\Users\Admin> & C:/Users/Admin/AppData/Local/Programs/Python/Python312/python.exe "c:/Users/Admin/Documents/Documentsi/Python file/import asyncio.py"

Traceback (most recent call last):

File "c:\Users\Admin\Documents\Documentsi\Python file\import asyncio.py", line 2, in

from aiogram import Bot, Dispatcher, executor, types

ImportError: cannot import name 'executor' from 'aiogram' (C:\Users\Admin\AppData\Local\Programs\Python\Pyth on312\Lib\site-packages\aiogram\__init__.py)

PS C:\Users\Admin> там што то с библиотекой аіограм я пробовал старую версию скачать но там ошибка в консоли джпт посоветовал

import asyncio

from aiogram import Bot, Dispatcher, executor, types

API_TOKEN = 'пенис'

bot = Bot(token=API_TOKEN)

dp = Dispatcher(bot)

@dp.message_handler(commands=['start'])

async def start_cmd(message: types.Message):

там дале разговор

chromiusj 04.08.2024 01:22

Цитата:

Сообщение от Fretsi_Rewy

Новая ошибка в терминале
PS C:\Users\Admin> & C:/Users/Admin/AppData/Local/Programs/Python/Python312/python.exe "c:/Users/Admin/Documents/Documentsi/Python file/import asyncio.py"
Traceback (most recent call last):
File "c:\Users\Admin\Documents\Documentsi\Python file\import asyncio.py", line 2, in
from aiogram import Bot, Dispatcher, executor, types
ImportError: cannot import name 'executor' from 'aiogram' (C:\Users\Admin\AppData\Local\Programs\Python\Pyth on312\Lib\site-packages\aiogram\__init__.py)
PS C:\Users\Admin> там што то с библиотекой аіограм я пробовал старую версию скачать но там ошибка в консоли джпт посоветовал

база чат гпт(по крайней мере 4.о) образована на прошлый год, там айограм старой версии, и многие функции были мигрированы

aiogram/examples/echo_bot.py at dev-3.x · aiogram/aiogram

aiogram is a modern and fully asynchronous framework for Telegram Bot API written in Python using asyncio - aiogram/aiogram

github.com

Fretsi_Rewy 04.08.2024 01:28

Цитата:

Сообщение от chromiusj

aiogram/examples/echo_bot.py at dev-3.x · aiogram/aiogram
база чат гпт(по крайней мере 4.о) образована на прошлый год, там айограм старой версии, и многие функции были мигрированы

aiogram/examples/echo_bot.py at dev-3.x · aiogram/aiogram

aiogram is a modern and fully asynchronous framework for Telegram Bot API written in Python using asyncio - aiogram/aiogram

github.com


Што мне с етим делать?

chromiusj 04.08.2024 01:30

Цитата:

Сообщение от Fretsi_Rewy

Што мне с етим делать?

писать под новый айограм, либо кормить чатгпт базу нового айограма,и дальше пытаться выбивать из него овтет

Fretsi_Rewy 04.08.2024 01:36

Цитата:

Сообщение от chromiusj

писать под новый айограм, либо кормить чатгпт базу нового айограма,и дальше пытаться выбивать из него овтет

У меня есть но што мне с аиограмом делать у него ошибка

PS C:\Users\Admin> & C:/Users/Admin/AppData/Local/Programs/Python/Python312/python.exe "c:/Users/Admin/Documents/Documentsi/Python file/bot.py"

Traceback (most recent call last):

File "c:\Users\Admin\Documents\Documentsi\Python file\bot.py", line 2, in

from aiogram import Bot, Dispatcher, executor, types

ImportError: cannot import name 'executor' from 'aiogram' (C:\Users\Admin\AppData\Local\Programs\Python\Pyth on312\Lib\site-packages\aiogram\__init__.py)

PS C:\Users\Admin>

код

import asyncio

from aiogram import Bot, Dispatcher, executor, types

API_TOKEN = ''

bot = Bot(token=API_TOKEN)

dp = Dispatcher(bot)

@dp.message_handler(commands=['start'])

async def start_cmd(message: types.Message):

chromiusj 04.08.2024 01:38

Цитата:

Сообщение от Fretsi_Rewy

У меня есть но што мне с аиограмом делать у него ошибка
PS C:\Users\Admin> & C:/Users/Admin/AppData/Local/Programs/Python/Python312/python.exe "c:/Users/Admin/Documents/Documentsi/Python file/bot.py"
Traceback (most recent call last):
File "c:\Users\Admin\Documents\Documentsi\Python file\bot.py", line 2, in
from aiogram import Bot, Dispatcher, executor, types
ImportError: cannot import name 'executor' from 'aiogram' (C:\Users\Admin\AppData\Local\Programs\Python\Pyth on312\Lib\site-packages\aiogram\__init__.py)
PS C:\Users\Admin>
код
import asyncio
from aiogram import Bot, Dispatcher, executor, types
API_TOKEN = ''
bot = Bot(token=API_TOKEN)
dp = Dispatcher(bot)
@dp.message_handler(commands=['start'])
async def start_cmd(message: types.Message):

переустанови айограм,и покажи какая версия у тебя

https://forum.antichat.xyz/attachmen...bfb56f35bf.png

Fretsi_Rewy 04.08.2024 01:42

Цитата:

Сообщение от chromiusj

переустанови айограм,и покажи какая версия у тебя

24.0

джп наелся и дал мне ответ щас проверю

fokichevskiy 04.08.2024 01:42

Цитата:

Сообщение от Fretsi_Rewy

24.0
джп наелся и дал мне ответ щас проверю

2.4.0?

Fretsi_Rewy 04.08.2024 01:45

Цитата:

Сообщение от fokichevskiy

2.4.0?

https://forum.antichat.xyz/attachmen...9c0d62990f.png
перепутал

fokichevskiy 04.08.2024 01:45

Цитата:

Сообщение от Fretsi_Rewy

перепутал

pip install --force-reinstall -v "aiogram==2.23.1" попробуй

Fretsi_Rewy 04.08.2024 01:48

Цитата:

Сообщение от fokichevskiy

pip install --force-reinstall -v "aiogram==2.23.1" попробуй

https://forum.antichat.xyz/attachmen...b40c9272c7.png

Цитата:

Сообщение от fokichevskiy

pip install --force-reinstall -v "aiogram==2.23.1" попробуй

ImportError: cannot import name 'executor' from 'aiogram.utils' (C:\Users\Admin\AppData\Local\Programs\Python\Pyth on312\Lib\site-packages\aiogram\utils\__init__.py)

PS C:\Users\Admin> & C:/Users/Admin/AppData/Local/Programs/Python/Python312/python.exe "c:/Users/Admin/Documents/Documentsi/Python file/bot.py"

Traceback (most recent call last):

File "c:\Users\Admin\Documents\Documentsi\Python file\bot.py", line 3, in

from aiogram.utils import executor

ImportError: cannot import name 'executor' from 'aiogram.utils' (C:\Users\Admin\AppData\Local\Programs\Python\Pyth on312\Lib\site-packages\aiogram\utils\__init__.py)

PS C:\Users\Admin>

Снов ета ошибка

fokichevskiy 04.08.2024 01:51

python:





Код:

#!venv/bin/python
import
logging
from
aiogram
import
Bot
,
Dispatcher
,
executor
,
types
# Объект бота
bot
=
Bot
(
token
=
"12345678:AaBbCcDdEeFfGgHh"
)
# Диспетчер для бота
dp
=
Dispatcher
(
bot
)
# Включаем логирование, чтобы не пропустить важные сообщения
logging
.
basicConfig
(
level
=
logging
.
INFO
)
# Хэндлер на команду /test1
@dp.message_handler
(
commands
=
"test1"
)
async
def
cmd_test1
(
message
:
types
.
Message
)
:
await
message
.
reply
(
"Test 1"
)
if
__name__
==
"__main__"
:
# Запуск бота
executor
.
start_polling
(
dp
,
skip_updates
=
True
)


Fretsi_Rewy 04.08.2024 01:57

Цитата:

Сообщение от fokichevskiy

python:





Код:

#!venv/bin/python
import
logging
from
aiogram
import
Bot
,
Dispatcher
,
executor
,
types
# Объект бота
bot
=
Bot
(
token
=
"12345678:AaBbCcDdEeFfGgHh"
)
# Диспетчер для бота
dp
=
Dispatcher
(
bot
)
# Включаем логирование, чтобы не пропустить важные сообщения
logging
.
basicConfig
(
level
=
logging
.
INFO
)
# Хэндлер на команду /test1
@dp.message_handler
(
commands
=
"test1"
)
async
def
cmd_test1
(
message
:
types
.
Message
)
:
await
message
.
reply
(
"Test 1"
)
if
__name__
==
"__main__"
:
# Запуск бота
executor
.
start_polling
(
dp
,
skip_updates
=
True
)



Спасибо вам што помогаете мне

fokichevskiy 04.08.2024 01:58

Цитата:

Сообщение от Fretsi_Rewy

Спасибо вам што помогаете мне

всё работает?

Fretsi_Rewy 04.08.2024 02:03

Цитата:

Сообщение от fokichevskiy

всё работает?

File "c:\Users\Admin\Documents\Documentsi\Python file\bot.py", line 3, in

from aiogram import Bot, Dispatcher, executor, types

ImportError: cannot import name 'executor' from 'aiogram' (C:\Users\Admin\AppData\Local\Programs\Python\Pyth on312\Lib\site-packages\aiogram\__init__.py)

PS C:\Users\Admin>

нет конешно

fokichevskiy 04.08.2024 02:04

Цитата:

Сообщение от Fretsi_Rewy

File "c:\Users\Admin\Documents\Documentsi\Python file\bot.py", line 3, in
from aiogram import Bot, Dispatcher, executor, types
ImportError: cannot import name 'executor' from 'aiogram' (C:\Users\Admin\AppData\Local\Programs\Python\Pyth on312\Lib\site-packages\aiogram\__init__.py)
PS C:\Users\Admin>
нет конешно

у тебя aiogram точно 2.23.1?

Fretsi_Rewy 04.08.2024 02:08

Цитата:

Сообщение от fokichevskiy

у тебя aiogram точно 2.23.1?

Вовсе aigram удалил и теперь скачать немогу иза ошибки ето только у меня столько мороки с ним?

https://forum.antichat.xyz/attachmen...c64b5d4ae6.png

теперь вовсе никакую версию немогу скачать

ERROR: Could not find a version that satisfies the requirement aigram (from versions: none)

ERROR: No matching distribution found for aigram

Цитата:

Сообщение от Fretsi_Rewy

Вовсе aigram удалил и теперь скачать немогу иза ошибки ето только у меня столько мороки с ним?

https://forum.antichat.xyz/attachmen...c64b5d4ae6.png

теперь вовсе никакую версию немогу скачать
ERROR: Could not find a version that satisfies the requirement aigram (from versions: none)
ERROR: No matching distribution found for aigram

https://forum.antichat.xyz/attachmen...4a5a0d7413.png

chromiusj 04.08.2024 12:11

Цитата:

Сообщение от Fretsi_Rewy

Вовсе aigram удалил и теперь скачать немогу иза ошибки ето только у меня столько мороки с ним?

теперь вовсе никакую версию немогу скачать
ERROR: Could not find a version that satisfies the requirement aigram (from versions: none)
ERROR: No matching distribution found for aigram

скачай

Latest Supported Visual C++ Redistributable Downloads

This article provides download links for the latest Visual C++ Redistributable packages.

learn.microsoft.com

Fretsi_Rewy 04.08.2024 16:06

Цитата:

Сообщение от chromiusj

скачай

Latest Supported Visual C++ Redistributable Downloads

This article provides download links for the latest Visual C++ Redistributable packages.

learn.microsoft.com


Спасибо всем я переустоновил библиотеку и все заработала уже допилил своего бота спасибо за то што помогли!

Цитата:

Сообщение от chromiusj

скачай

Latest Supported Visual C++ Redistributable Downloads

This article provides download links for the latest Visual C++ Redistributable packages.

learn.microsoft.com


Спасибо большое што помогли я вроде писал уже все работает просто библиотеку переустоновил и джп напичкал и все круто есть полностю работает мой тг бот Неподкажеш есть ли какието бесплатние хости?

govno coder 13.08.2025 02:27

Цитата:

Сообщение от Fretsi_Rewy

Спасибо всем я переустоновил библиотеку и все заработала уже допилил своего бота спасибо за то што помогли!

Спасибо большое што помогли я вроде писал уже все работает просто библиотеку переустоновил и джп напичкал и все круто есть полностю работает мой тг бот Неподкажеш есть ли какието бесплатние хости?

render


Время: 17:37