1200wd / bitcoinlib

Bitcoin and other Cryptocurrencies Library for Python. Includes a fully functional wallet, Mnemonic key generation and management and connection with various service providers to receive and send blockchain and transaction information.
http://bitcoinlib.readthedocs.io/
GNU General Public License v3.0
615 stars 204 forks source link

Can't pip install bitcoinlib on Windows 10 #238

Closed wkila closed 2 years ago

wkila commented 2 years ago

PLS HELP I CANT FIX THIS ALL ERRORS (THIS IS 7TH ERROR) FOR LIKE A 6 HOURS PLS HELP

Building wheels for collected packages: scrypt
  Building wheel for scrypt (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for scrypt (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [50 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build\lib.win-amd64-cpython-310
      creating build\lib.win-amd64-cpython-310\scrypt
      copying scrypt\scrypt.py -> build\lib.win-amd64-cpython-310\scrypt
      copying scrypt\__init__.py -> build\lib.win-amd64-cpython-310\scrypt
      creating build\lib.win-amd64-cpython-310\scrypt\tests
      copying scrypt\tests\test_scrypt.py -> build\lib.win-amd64-cpython-310\scrypt\tests
      copying scrypt\tests\test_scrypt_c_module.py -> build\lib.win-amd64-cpython-310\scrypt\tests
      copying scrypt\tests\test_scrypt_py2x.py -> build\lib.win-amd64-cpython-310\scrypt\tests
      copying scrypt\tests\test_scrypt_py3x.py -> build\lib.win-amd64-cpython-310\scrypt\tests
      copying scrypt\tests\__init__.py -> build\lib.win-amd64-cpython-310\scrypt\tests
      copying scrypt\tests\ciphertexts.csv -> build\lib.win-amd64-cpython-310\scrypt\tests
      copying scrypt\tests\hashvectors.csv -> build\lib.win-amd64-cpython-310\scrypt\tests
      running build_ext
      building '_scrypt' extension
      creating build\temp.win-amd64-cpython-310
      creating build\temp.win-amd64-cpython-310\Release
      creating build\temp.win-amd64-cpython-310\Release\scrypt-1.2.1
      creating build\temp.win-amd64-cpython-310\Release\scrypt-1.2.1\lib
      creating build\temp.win-amd64-cpython-310\Release\scrypt-1.2.1\lib\crypto
      creating build\temp.win-amd64-cpython-310\Release\scrypt-1.2.1\lib\scryptenc
      creating build\temp.win-amd64-cpython-310\Release\scrypt-1.2.1\lib\util
      creating build\temp.win-amd64-cpython-310\Release\scrypt-1.2.1\libcperciva
      creating build\temp.win-amd64-cpython-310\Release\scrypt-1.2.1\libcperciva\alg
      creating build\temp.win-amd64-cpython-310\Release\scrypt-1.2.1\libcperciva\crypto
      creating build\temp.win-amd64-cpython-310\Release\scrypt-1.2.1\libcperciva\util
      creating build\temp.win-amd64-cpython-310\Release\scrypt-windows-stubs
      creating build\temp.win-amd64-cpython-310\Release\src
      "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -DHAVE_CONFIG_H -Dinline=__inline -Iscrypt-1.2.1 -Iscrypt-1.2.1/lib -Iscrypt-1.2.1/lib/scryptenc -Iscrypt-1.2.1/lib/crypto -Iscrypt-1.2.1/lib/util -Iscrypt-1.2.1/libcperciva/cpusupport -Iscrypt-1.2.1/libcperciva/alg -Iscrypt-1.2.1/libcperciva/util -Iscrypt-1.2.1/libcperciva/crypto -Ic:\OpenSSL-Win64\include -Iscrypt-windows-stubs/include -IC:\Users\jaNeight\AppData\Local\Programs\Python\Python310\include -IC:\Users\jaNeight\AppData\Local\Programs\Python\Python310\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt" /Tcscrypt-1.2.1/lib/crypto/crypto_scrypt.c /Fobuild\temp.win-amd64-cpython-310\Release\scrypt-1.2.1/lib/crypto/crypto_scrypt.obj    
      crypto_scrypt.c
      "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -DHAVE_CONFIG_H -Dinline=__inline -Iscrypt-1.2.1 -Iscrypt-1.2.1/lib -Iscrypt-1.2.1/lib/scryptenc -Iscrypt-1.2.1/lib/crypto -Iscrypt-1.2.1/lib/util -Iscrypt-1.2.1/libcperciva/cpusupport -Iscrypt-1.2.1/libcperciva/alg -Iscrypt-1.2.1/libcperciva/util -Iscrypt-1.2.1/libcperciva/crypto -Ic:\OpenSSL-Win64\include -Iscrypt-windows-stubs/include -IC:\Users\jaNeight\AppData\Local\Programs\Python\Python310\include -IC:\Users\jaNeight\AppData\Local\Programs\Python\Python310\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt" /Tcscrypt-1.2.1/lib/crypto/crypto_scrypt_smix.c /Fobuild\temp.win-amd64-cpython-310\Release\scrypt-1.2.1/lib/crypto/crypto_scrypt_smix.obj
      crypto_scrypt_smix.c
      "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -DHAVE_CONFIG_H -Dinline=__inline -Iscrypt-1.2.1 -Iscrypt-1.2.1/lib -Iscrypt-1.2.1/lib/scryptenc -Iscrypt-1.2.1/lib/crypto -Iscrypt-1.2.1/lib/util -Iscrypt-1.2.1/libcperciva/cpusupport -Iscrypt-1.2.1/libcperciva/alg -Iscrypt-1.2.1/libcperciva/util -Iscrypt-1.2.1/libcperciva/crypto -Ic:\OpenSSL-Win64\include -Iscrypt-windows-stubs/include -IC:\Users\jaNeight\AppData\Local\Programs\Python\Python310\include -IC:\Users\jaNeight\AppData\Local\Programs\Python\Python310\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt" /Tcscrypt-1.2.1/lib/crypto/crypto_scrypt_smix_sse2.c /Fobuild\temp.win-amd64-cpython-310\Release\scrypt-1.2.1/lib/crypto/crypto_scrypt_smix_sse2.obj
      crypto_scrypt_smix_sse2.c
      "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -DHAVE_CONFIG_H -Dinline=__inline -Iscrypt-1.2.1 -Iscrypt-1.2.1/lib -Iscrypt-1.2.1/lib/scryptenc -Iscrypt-1.2.1/lib/crypto -Iscrypt-1.2.1/lib/util -Iscrypt-1.2.1/libcperciva/cpusupport -Iscrypt-1.2.1/libcperciva/alg -Iscrypt-1.2.1/libcperciva/util -Iscrypt-1.2.1/libcperciva/crypto -Ic:\OpenSSL-Win64\include -Iscrypt-windows-stubs/include -IC:\Users\jaNeight\AppData\Local\Programs\Python\Python310\include -IC:\Users\jaNeight\AppData\Local\Programs\Python\Python310\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt" /Tcscrypt-1.2.1/lib/scryptenc/scryptenc.c /Fobuild\temp.win-amd64-cpython-310\Release\scrypt-1.2.1/lib/scryptenc/scryptenc.obj      
      scryptenc.c
      scrypt-1.2.1/lib/scryptenc/scryptenc.c(125): warning C4244: '=': conversion from 'size_t' to 'double', possible loss of data
      "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -DHAVE_CONFIG_H -Dinline=__inline -Iscrypt-1.2.1 -Iscrypt-1.2.1/lib -Iscrypt-1.2.1/lib/scryptenc -Iscrypt-1.2.1/lib/crypto -Iscrypt-1.2.1/lib/util -Iscrypt-1.2.1/libcperciva/cpusupport -Iscrypt-1.2.1/libcperciva/alg -Iscrypt-1.2.1/libcperciva/util -Iscrypt-1.2.1/libcperciva/crypto -Ic:\OpenSSL-Win64\include -Iscrypt-windows-stubs/include -IC:\Users\jaNeight\AppData\Local\Programs\Python\Python310\include -IC:\Users\jaNeight\AppData\Local\Programs\Python\Python310\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt" /Tcscrypt-1.2.1/lib/scryptenc/scryptenc_cpuperf.c /Fobuild\temp.win-amd64-cpython-310\Release\scrypt-1.2.1/lib/scryptenc/scryptenc_cpuperf.obj
      scryptenc_cpuperf.c
      "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -DHAVE_CONFIG_H -Dinline=__inline -Iscrypt-1.2.1 -Iscrypt-1.2.1/lib -Iscrypt-1.2.1/lib/scryptenc -Iscrypt-1.2.1/lib/crypto -Iscrypt-1.2.1/lib/util -Iscrypt-1.2.1/libcperciva/cpusupport -Iscrypt-1.2.1/libcperciva/alg -Iscrypt-1.2.1/libcperciva/util -Iscrypt-1.2.1/libcperciva/crypto -Ic:\OpenSSL-Win64\include -Iscrypt-windows-stubs/include -IC:\Users\jaNeight\AppData\Local\Programs\Python\Python310\include -IC:\Users\jaNeight\AppData\Local\Programs\Python\Python310\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt" /Tcscrypt-1.2.1/lib/util/memlimit.c /Fobuild\temp.win-amd64-cpython-310\Release\scrypt-1.2.1/lib/util/memlimit.obj
      memlimit.c
      "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -DHAVE_CONFIG_H -Dinline=__inline -Iscrypt-1.2.1 -Iscrypt-1.2.1/lib -Iscrypt-1.2.1/lib/scryptenc -Iscrypt-1.2.1/lib/crypto -Iscrypt-1.2.1/lib/util -Iscrypt-1.2.1/libcperciva/cpusupport -Iscrypt-1.2.1/libcperciva/alg -Iscrypt-1.2.1/libcperciva/util -Iscrypt-1.2.1/libcperciva/crypto -Ic:\OpenSSL-Win64\include -Iscrypt-windows-stubs/include -IC:\Users\jaNeight\AppData\Local\Programs\Python\Python310\include -IC:\Users\jaNeight\AppData\Local\Programs\Python\Python310\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt" /Tcscrypt-1.2.1/libcperciva/alg/sha256.c /Fobuild\temp.win-amd64-cpython-310\Release\scrypt-1.2.1/libcperciva/alg/sha256.obj        
      sha256.c
      "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -DHAVE_CONFIG_H -Dinline=__inline -Iscrypt-1.2.1 -Iscrypt-1.2.1/lib -Iscrypt-1.2.1/lib/scryptenc -Iscrypt-1.2.1/lib/crypto -Iscrypt-1.2.1/lib/util -Iscrypt-1.2.1/libcperciva/cpusupport -Iscrypt-1.2.1/libcperciva/alg -Iscrypt-1.2.1/libcperciva/util -Iscrypt-1.2.1/libcperciva/crypto -Ic:\OpenSSL-Win64\include -Iscrypt-windows-stubs/include -IC:\Users\jaNeight\AppData\Local\Programs\Python\Python310\include -IC:\Users\jaNeight\AppData\Local\Programs\Python\Python310\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt" /Tcscrypt-1.2.1/libcperciva/crypto/crypto_aes.c /Fobuild\temp.win-amd64-cpython-310\Release\scrypt-1.2.1/libcperciva/crypto/crypto_aes.obj
      crypto_aes.c
      scrypt-1.2.1/libcperciva/crypto/crypto_aes.c(6): fatal error C1083: Cannot open include file: 'openssl/aes.h': No such file or directory
      error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
      [end of output]

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

The problem seems related to the scrypt library, you could try to install the scrypt package separately before installing bitcoinlib.

Otherwise see https://pypi.org/project/scrypt/ for Windows installation instructions of scrypt.

Please let me know if this works for you.

Pep3M commented 2 years ago

The problem seems related to the scrypt library, you could try to install the scrypt package separately before installing bitcoinlib.

Otherwise see https://pypi.org/project/scrypt/ for Windows installation instructions of scrypt.

Please let me know if this works for you.

Hi.

I also have more than one problem installing the library, both in my local environment with Windows and in my vps with Linux. The scrypt library does not install for me due to this error: scrypt-1.2.1/lib/crypto/crypto_scrypt.c(31): fatal error C1083:... and on Linux the problem is caused by the library fastecdsa (error: command 'x86_64-linux-gnu-gcc' failed: No such file or directory). In both cases I use Python 3.10.

I have searched in many forums and I have tried many methods, I still do not find the solution.

mccwdev commented 2 years ago
Pep3M commented 2 years ago
  • fastecdsa does not work in Windows, you have to use the ecdsa library instead
  • scrypt should work, but installation can be difficult. However it is not part of this project and I'm not really able to help you with this. For scypt related question be check their project page: https://pypi.org/project/scrypt/
  • instead of scrypt you could try to install the pyscrypt library, but that project is not maintained anymore, and I haven't test it for a while

Thanks for taking the time to help me.

I have installed both libraries, ecsda and pyscrypt, but still trying to install bitcoinlib it seems to keep trying to install with scrypt: Building wheel for scrypt (pyproject.toml) ... error

how can i tell it to install via pyscrypt?

mccwdev commented 2 years ago

This only works if you use git clone and install manually, then the code looks which modules are installed: https://github.com/1200wd/bitcoinlib/blob/7f975a80aabd2d6e8b73c013d4ca6d0724fda54d/bitcoinlib/encoding.py#L39

Did you install all required packages: https://bitcoinlib.readthedocs.io/en/latest/source/_static/manuals.install.html ?

The Linux error suggests you miss the python3-dev packages.

Pep3M commented 2 years ago

Nothing!! I try everything to install this awesome library in my two workspace (linux n windows). I follow every step, modify the install script to alternative packages (ecdsa, pyscrypt)... I hope in the future this problem can be resolved

mccwdev commented 2 years ago

The latest release https://github.com/1200wd/bitcoinlib/releases/tag/0.6.5 should fix these issues. For example the installation of scrypt is not required anymore to use the library.