pyrogram / tgcrypto

Fast and Portable Cryptography Extension Library for Pyrogram
https://pyrogram.org
GNU Lesser General Public License v3.0
175 stars 41 forks source link

Wheel building fails on Python 3.12 stable #37

Open hazy-kun opened 8 months ago

hazy-kun commented 8 months ago

Unable to install on Python 3.12, missing pre-built wheel for this version, Visual Studio 2022 and vcredist are installed on the PC so the problem is on TgCrypto

Collecting TgCrypto
  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
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
  ╰─> [19 lines of output]
      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
Morrigan-Ship commented 8 months ago

same problem on python 12 , 8 versions

reinaldo-br commented 8 months ago

I am having the same issue, any solutions so far?

landgrafhomyak commented 8 months ago

Are you added path to MSVC binaries to PATH environment variable?

hazy-kun commented 8 months ago

With 3.11.6 i no need to add nothin on path so i think it's not environment problem or configuration problem

amirzib commented 6 months ago

guys, I had the same problem with Python 3.12 and even tried to upgrade the pip version but it didn't work

Then I installed Microsoft C++ Build Tools and it's finally working! (you can find it here: https://visualstudio.microsoft.com/visual-cpp-build-tools/ )

10262 Be sure to add a checkmark to Visual C++ build tools

I hope I could help!

robertrodrigues commented 5 months ago

The above worked for me. Thank you @amirzib ! One thing to note for anyone else - When you go into workloads, I didnt have the exact above selection, but instead had "desktop development with c++" The selections on the right turn out the same though

Tapanhaz commented 4 months ago

If anyone need, I uploaded the wheel for 3.12 in : https://raw.githubusercontent.com/Tapanhaz/My_Builds/main/TgCrypto-1.2.5-cp312-cp312-win_amd64.whl

hazy-kun commented 2 months ago

If someone want i rebuilt wheel and published under package name mtprotocrypt, install it instead of tgcrypto to support all OS from 3.9.x to 3.12.x

njuusx commented 2 weeks ago

If anyone need, I uploaded the wheel for 3.12 in : https://raw.githubusercontent.com/Tapanhaz/My_Builds/main/TgCrypto-1.2.5-cp312-cp312-win_amd64.whl

wow thanks broooooo! <3 youre save me