Alexell / XEmpireBot

Bot that earn money in X Empire (Musk Empire)
137 stars 35 forks source link

Error opening file "Start" #49

Closed MikhailKamado closed 3 months ago

MikhailKamado commented 3 months ago
Creating virtual environment...
Activating virtual environment...
Installing dependencies...
Collecting pydantic-settings==2.3.4 (from -r requirements.txt (line 1))
  Using cached pydantic_settings-2.3.4-py3-none-any.whl.metadata (3.3 kB)
Collecting aiohttp==3.9.5 (from -r requirements.txt (line 2))
  Using cached aiohttp-3.9.5-cp312-cp312-win_amd64.whl.metadata (7.7 kB)
Collecting aiohttp-proxy==0.1.2 (from -r requirements.txt (line 3))
  Using cached aiohttp_proxy-0.1.2-py3-none-any.whl.metadata (2.7 kB)
Collecting better-proxy==1.2.0 (from -r requirements.txt (line 4))
  Using cached better_proxy-1.2.0-py3-none-any.whl.metadata (3.2 kB)
Collecting loguru==0.7.2 (from -r requirements.txt (line 5))
  Using cached loguru-0.7.2-py3-none-any.whl.metadata (23 kB)
Collecting Pyrogram==2.0.106 (from -r requirements.txt (line 6))
  Using cached Pyrogram-2.0.106-py3-none-any.whl.metadata (4.4 kB)
Collecting TgCrypto==1.2.5 (from -r requirements.txt (line 7))
  Using cached TgCrypto-1.2.5.tar.gz (37 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting tzdata==2024.1 (from -r requirements.txt (line 8))
  Using cached tzdata-2024.1-py2.py3-none-any.whl.metadata (1.4 kB)
Collecting pydantic>=2.7.0 (from pydantic-settings==2.3.4->-r requirements.txt (line 1))
  Using cached pydantic-2.8.2-py3-none-any.whl.metadata (125 kB)
Collecting python-dotenv>=0.21.0 (from pydantic-settings==2.3.4->-r requirements.txt (line 1))
  Using cached python_dotenv-1.0.1-py3-none-any.whl.metadata (23 kB)
Collecting aiosignal>=1.1.2 (from aiohttp==3.9.5->-r requirements.txt (line 2))
  Using cached aiosignal-1.3.1-py3-none-any.whl.metadata (4.0 kB)
Collecting attrs>=17.3.0 (from aiohttp==3.9.5->-r requirements.txt (line 2))
  Using cached attrs-24.2.0-py3-none-any.whl.metadata (11 kB)
Collecting frozenlist>=1.1.1 (from aiohttp==3.9.5->-r requirements.txt (line 2))
  Using cached frozenlist-1.4.1-cp312-cp312-win_amd64.whl.metadata (12 kB)
Collecting multidict<7.0,>=4.5 (from aiohttp==3.9.5->-r requirements.txt (line 2))
  Using cached multidict-6.0.5-cp312-cp312-win_amd64.whl.metadata (4.3 kB)
Collecting yarl<2.0,>=1.0 (from aiohttp==3.9.5->-r requirements.txt (line 2))
  Using cached yarl-1.9.4-cp312-cp312-win_amd64.whl.metadata (32 kB)
Collecting colorama>=0.3.4 (from loguru==0.7.2->-r requirements.txt (line 5))
  Using cached colorama-0.4.6-py2.py3-none-any.whl.metadata (17 kB)
Collecting win32-setctime>=1.0.0 (from loguru==0.7.2->-r requirements.txt (line 5))
  Using cached win32_setctime-1.1.0-py3-none-any.whl.metadata (2.3 kB)
Collecting pyaes==1.6.1 (from Pyrogram==2.0.106->-r requirements.txt (line 6))
  Using cached pyaes-1.6.1-py3-none-any.whl
Collecting pysocks==1.7.1 (from Pyrogram==2.0.106->-r requirements.txt (line 6))
  Using cached PySocks-1.7.1-py3-none-any.whl.metadata (13 kB)
Collecting annotated-types>=0.4.0 (from pydantic>=2.7.0->pydantic-settings==2.3.4->-r requirements.txt (line 1))
  Using cached annotated_types-0.7.0-py3-none-any.whl.metadata (15 kB)
Collecting pydantic-core==2.20.1 (from pydantic>=2.7.0->pydantic-settings==2.3.4->-r requirements.txt (line 1))
  Using cached pydantic_core-2.20.1-cp312-none-win_amd64.whl.metadata (6.7 kB)
Collecting typing-extensions>=4.6.1 (from pydantic>=2.7.0->pydantic-settings==2.3.4->-r requirements.txt (line 1))
  Using cached typing_extensions-4.12.2-py3-none-any.whl.metadata (3.0 kB)
Collecting idna>=2.0 (from yarl<2.0,>=1.0->aiohttp==3.9.5->-r requirements.txt (line 2))
  Using cached idna-3.7-py3-none-any.whl.metadata (9.9 kB)
Using cached pydantic_settings-2.3.4-py3-none-any.whl (22 kB)
Using cached aiohttp-3.9.5-cp312-cp312-win_amd64.whl (369 kB)
Using cached aiohttp_proxy-0.1.2-py3-none-any.whl (12 kB)
Using cached better_proxy-1.2.0-py3-none-any.whl (3.8 kB)
Using cached loguru-0.7.2-py3-none-any.whl (62 kB)
Using cached Pyrogram-2.0.106-py3-none-any.whl (3.6 MB)
Using cached tzdata-2024.1-py2.py3-none-any.whl (345 kB)
Using cached PySocks-1.7.1-py3-none-any.whl (16 kB)
Using cached aiosignal-1.3.1-py3-none-any.whl (7.6 kB)
Using cached attrs-24.2.0-py3-none-any.whl (63 kB)
Using cached colorama-0.4.6-py2.py3-none-any.whl (25 kB)
Using cached frozenlist-1.4.1-cp312-cp312-win_amd64.whl (50 kB)
Using cached multidict-6.0.5-cp312-cp312-win_amd64.whl (27 kB)
Using cached pydantic-2.8.2-py3-none-any.whl (423 kB)
Using cached pydantic_core-2.20.1-cp312-none-win_amd64.whl (1.9 MB)
Using cached python_dotenv-1.0.1-py3-none-any.whl (19 kB)
Using cached win32_setctime-1.1.0-py3-none-any.whl (3.6 kB)
Using cached yarl-1.9.4-cp312-cp312-win_amd64.whl (76 kB)
Using cached annotated_types-0.7.0-py3-none-any.whl (13 kB)
Using cached idna-3.7-py3-none-any.whl (66 kB)
Using cached typing_extensions-4.12.2-py3-none-any.whl (37 kB)
Building wheels for collected packages: TgCrypto
  Building wheel for TgCrypto (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for TgCrypto (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [21 lines of output]
      C:\Users\mikha\AppData\Local\Temp\pip-build-env-pb6hrmly\overlay\Lib\site-packages\setuptools\_distutils\dist.py:268: UserWarning: Unknown distribution option: 'test_suite'
        warnings.warn(msg)
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build\lib.win-amd64-cpython-312
      creating build\lib.win-amd64-cpython-312\tests
      copying tests\__init__.py -> build\lib.win-amd64-cpython-312\tests
      creating build\lib.win-amd64-cpython-312\tests\cbc
      copying tests\cbc\test_cbc.py -> build\lib.win-amd64-cpython-312\tests\cbc
      copying tests\cbc\__init__.py -> build\lib.win-amd64-cpython-312\tests\cbc
      creating build\lib.win-amd64-cpython-312\tests\ctr
      copying tests\ctr\test_ctr.py -> build\lib.win-amd64-cpython-312\tests\ctr
      copying tests\ctr\__init__.py -> build\lib.win-amd64-cpython-312\tests\ctr
      creating build\lib.win-amd64-cpython-312\tests\ige
      copying tests\ige\test_ige.py -> build\lib.win-amd64-cpython-312\tests\ige
      copying tests\ige\__init__.py -> build\lib.win-amd64-cpython-312\tests\ige
      running build_ext
      building 'tgcrypto' extension
      error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for TgCrypto
Failed to build TgCrypto
ERROR: Could not build wheels for TgCrypto, which is required to install pyproject.toml-based projects

[notice] A new release of pip is available: 24.0 -> 24.2
[notice] To update, run: python.exe -m pip install --upgrade pip
Copying .env-example to .env...
Please edit the .env file to add your API_ID and API_HASH.

Entered into the console: python.exe -m pip install --upgrade pip Issued: Requirement already satisfied: pip in c:\users\mikha\appdata\local\programs\python\python312\lib\site-packages (24.2)

zv09 commented 3 months ago

у тебя вроде не в пипах проблема... а в C++ Redistributable package или как он там называется.. (я не сижу на винде) error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/ попробуй поставить пакет с сайта винды последний со всеми апдейтами 2015-2024 или чего там сейчас последнего и билд-тулы тоже, дали же ссылку прямо в логе

Alexell commented 3 months ago

Indeed, everything is written in the log. The problem does not relate to the bot.

MikhailKamado commented 3 months ago

Okay, I installed C++ and everything was installed. But now there is a new problem, a profile is not created in “Start” writes:

Activating virtual environment...
Starting the bot...
2024-08-10 21:33:04 | INFO     | 90 | Detected 0 sessions | 0 proxies

██   ██     ███████ ███    ███ ██████  ██ ██████  ███████     ██████   ██████  ████████
 ██ ██      ██      ████  ████ ██   ██ ██ ██   ██ ██          ██   ██ ██    ██    ██
  ███       █████   ██ ████ ██ ██████  ██ ██████  █████       ██████  ██    ██    ██
 ██ ██      ██      ██  ██  ██ ██      ██ ██   ██ ██          ██   ██ ██    ██    ██
██   ██     ███████ ██      ██ ██      ██ ██   ██ ███████     ██████   ██████     ██

Select an action:
    1. Create session
    2. Run bot

> 1

Enter the session name (press Enter to exit): Test
Traceback (most recent call last):
  File "C:\Users\mikha\Desktop\XEmpireBot-main\main.py", line 11, in <module>
    asyncio.run(main())
  File "C:\Users\mikha\AppData\Local\Programs\Python\Python312\Lib\asyncio\runners.py", line 194, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "C:\Users\mikha\AppData\Local\Programs\Python\Python312\Lib\asyncio\runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\mikha\AppData\Local\Programs\Python\Python312\Lib\asyncio\base_events.py", line 687, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "C:\Users\mikha\Desktop\XEmpireBot-main\main.py", line 6, in main
    await launcher.start()
  File "C:\Users\mikha\Desktop\XEmpireBot-main\bot\core\launcher.py", line 103, in start
    await register_sessions()
  File "C:\Users\mikha\Desktop\XEmpireBot-main\bot\core\launcher.py", line 27, in register_sessions
    if not os.path.exists(path='sessions'): os.mkdir(path='sessions')
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: nt._path_exists() takes no keyword arguments
Для продолжения нажмите любую клавишу . . .
zv09 commented 3 months ago

well, as quick method, you can manually add an empty folder 'sessions' in project dir and try to re-run

Alexell commented 3 months ago

@MikhailKamado you must use Python 3.10, not 3.12!

Nord1cWarr1or commented 3 months ago

@Alexell хз, у меня на 3.12 всё работает без проблем...

Alexell commented 3 months ago

@Nord1cWarr1or тогда тебе повезло. Или может быть у тебя на линуксе? Именно с винды на 3.12 разные люди присылали одну и ту же ошибку, пожалуй я поправлю этот момент, хотя это не ошибка так то. Просто эти функции не принимают именованных аргументов, а Python 3.10 видимо не такой строгий, поэтому пропускал.

Nord1cWarr1or commented 3 months ago

@Nord1cWarr1or тогда тебе повезло. Или может быть у тебя на линуксе? Именно с винды на 3.12 разные люди присылали одну и ту же ошибку, пожалуй я поправлю этот момент, хотя это не ошибка так то. Просто эти функции не принимают именованных аргументов, а Python 3.10 видимо не такой строгий, поэтому пропускал.

Да, всё верно, у меня Линукс. Не знал, что на винде не работает..

Alexell commented 3 months ago

@Nord1cWarr1or запустил в VirtualBox новую Ubuntu, где уже Python 3.12, там я получаю ту же ошибку (первую, о которой была речь). Похоже, что TgCrypto отсутствует в pip в виде собранного пакета и он будет компилироваться из исходников. Но для этого, что на винде, что на линуксе, нужно ставить дополнительный софт, к примеру на линуксе:

apt install build-essential
apt install python3-dev

После этого можно уже выполнить pip3 install -r requirements.txt и TgCrypto компилируется успешно

Раз уж я добрался до этого, чуть позже проверю работу бота на Python 3.12, поправлю, если еще что найду, помимо ситуации с именованными аргументами выше.

MikhailKamado commented 3 months ago

Installed Python 3.10, but now another error:

Activating virtual environment...
Starting the bot...
TgCrypto is missing! Pyrogram will work the same, but at a much slower speed. More info: https://docs.pyrogram.org/topics/speedups
Traceback (most recent call last):
  File "C:\Users\mikha\Desktop\XEmpireBot-main\main.py", line 2, in <module>
    from bot.core import launcher
  File "C:\Users\mikha\Desktop\XEmpireBot-main\bot\core\launcher.py", line 6, in <module>
    from better_proxy import Proxy
  File "C:\Users\mikha\Desktop\XEmpireBot-main\venv\lib\site-packages\better_proxy\__init__.py", line 1, in <module>
    from .proxy import Proxy, parse_proxy_str
  File "C:\Users\mikha\Desktop\XEmpireBot-main\venv\lib\site-packages\better_proxy\proxy.py", line 5, in <module>
    from pydantic import BaseModel
  File "C:\Users\mikha\Desktop\XEmpireBot-main\venv\lib\site-packages\pydantic\__init__.py", line 404, in __getattr__
    module = import_module(module_name, package=package)
  File "C:\Users\mikha\AppData\Local\Programs\Python\Python310\lib\importlib\__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "C:\Users\mikha\Desktop\XEmpireBot-main\venv\lib\site-packages\pydantic\main.py", line 27, in <module>
    import pydantic_core
  File "C:\Users\mikha\Desktop\XEmpireBot-main\venv\lib\site-packages\pydantic_core\__init__.py", line 6, in <module>
    from ._pydantic_core import (
ModuleNotFoundError: No module named 'pydantic_core._pydantic_core'
Для продолжения нажмите любую клавишу . . .
Alexell commented 3 months ago

pip3 install -r requirements.txt