ebellocchia / bip_utils

Generation of mnemonics, seeds, private/public keys and addresses for different types of cryptocurrencies
MIT License
324 stars 86 forks source link

Problem with installing on RaspberryPi #41

Closed mehdiirh closed 2 years ago

mehdiirh commented 2 years ago

Hi, Thanks for your awesome module. I installed bip_utils on my own PC ( Arch/Manjaro ) and it works just perfect. But when I try to install it on my RPi 4 (with Raspberry Pi OS), I get errors:

(venv) pi@raspberrypi:~/Desktop/backer $ pip install bip_utils
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting bip_utils
  Using cached https://www.piwheels.org/simple/bip-utils/bip_utils-2.1.0-py3-none-any.whl (377 kB)
Collecting pynacl~=1.1
  Using cached https://www.piwheels.org/simple/pynacl/PyNaCl-1.4.0-cp39-cp39-linux_armv7l.whl (599 kB)
Collecting pycryptodome~=3.6
  Using cached https://www.piwheels.org/simple/pycryptodome/pycryptodome-3.12.0-cp35-abi3-linux_armv7l.whl (1.8 MB)
Collecting py-sr25519-bindings<2.0.0,>=0.1.3
  Using cached py_sr25519_bindings-0.1.4.tar.gz (13 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... error
    ERROR: Command errored out with exit status 1:
     command: /home/pi/Desktop/coinopal_backer/venv/bin/python /tmp/tmpk7ridpje_in_process.py prepare_metadata_for_build_wheel /tmp/tmpaymolx6g
         cwd: /tmp/pip-install-c6wxh9ub/py-sr25519-bindings_a7ba08a045b242d78cd2415ac56a67ce
    Complete output (6 lines):

    Cargo, the Rust package manager, is not installed or is not on PATH.
    This package requires Rust and Cargo to compile extensions. Install it through
    the system's package manager or via https://rustup.rs/

    Checking for Rust toolchain....
    ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/64/82/f55600547af686b1ef3db123471493800ce6f9a61ac7a9e355b3bd6360aa/py_sr25519_bindings-0.1.4.tar.gz#sha256=5e12ca977014f148f4bfb6ba662f1529b15cc8ce030719d726c4e16a379e976e (from https://pypi.org/simple/py-sr25519-bindings/). Command errored out with exit status 1: /home/pi/Desktop/coinopal_backer/venv/bin/python /tmp/tmpk7ridpje_in_process.py prepare_metadata_for_build_wheel /tmp/tmpaymolx6g Check the logs for full command output.
  Using cached py_sr25519_bindings-0.1.3.tar.gz (13 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... error
    ERROR: Command errored out with exit status 1:
     command: /home/pi/Desktop/coinopal_backer/venv/bin/python /tmp/tmpb8bxbub1_in_process.py prepare_metadata_for_build_wheel /tmp/tmpx9wmg0wi
         cwd: /tmp/pip-install-c6wxh9ub/py-sr25519-bindings_200e206b958348f289959e8c88a18fe5
    Complete output (6 lines):

    Cargo, the Rust package manager, is not installed or is not on PATH.
    This package requires Rust and Cargo to compile extensions. Install it through
    the system's package manager or via https://rustup.rs/

    Checking for Rust toolchain....
    ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/bd/32/1b0dd06842466d2e2f9d6af89752f8aafe4d8f85d7bdc5246cece985eb30/py_sr25519_bindings-0.1.3.tar.gz#sha256=8b72ac823b63adf30cd9596508773b93da5ae4a73fb869e1e27266fb3e7ddaea (from https://pypi.org/simple/py-sr25519-bindings/). Command errored out with exit status 1: /home/pi/Desktop/coinopal_backer/venv/bin/python /tmp/tmpb8bxbub1_in_process.py prepare_metadata_for_build_wheel /tmp/tmpx9wmg0wi Check the logs for full command output.
Collecting bip_utils
  Using cached https://www.piwheels.org/simple/bip-utils/bip_utils-2.0.2-py3-none-any.whl (375 kB)
Requirement already satisfied: ecdsa~=0.14 in ./venv/lib/python3.9/site-packages (from bip_utils) (0.17.0)
  Using cached https://www.piwheels.org/simple/bip-utils/bip_utils-2.0.1-py3-none-any.whl (370 kB)
  Using cached https://www.piwheels.org/simple/bip-utils/bip_utils-2.0.0-py3-none-any.whl (370 kB)
  Using cached https://www.piwheels.org/simple/bip-utils/bip_utils-1.11.1-py3-none-any.whl (157 kB)
Requirement already satisfied: pysha3 in ./venv/lib/python3.9/site-packages (from bip_utils) (1.0.2)
Requirement already satisfied: six>=1.9.0 in ./venv/lib/python3.9/site-packages (from ecdsa~=0.14->bip_utils) (1.16.0)
Installing collected packages: bip-utils
Successfully installed bip-utils-1.11.1
mehdiirh commented 2 years ago

Also with --coincurve=0:

(venv) pi@raspberrypi:~/Desktop/coinopal_backer $ pip install bip_utils --install-option="--coincurve=0"
/home/pi/Desktop/coinopal_backer/venv/lib/python3.9/site-packages/pip/_internal/commands/install.py:245: UserWarning: Disabling all use of wheels due to the use of --build-option / --global-option / --install-option.
  cmdoptions.check_install_build_global(options)
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting bip_utils
  Using cached bip_utils-2.1.0.tar.gz (269 kB)
Collecting coincurve<16.0.0,>=15.0.1
  Using cached coincurve-15.0.1.tar.gz (223 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... error
  ERROR: Command errored out with exit status 1:
   command: /home/pi/Desktop/coinopal_backer/venv/bin/python /home/pi/Desktop/coinopal_backer/venv/lib/python3.9/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-kwp5_uah/normal --no-warn-script-location --no-binary :all: --only-binary :none: -i https://pypi.org/simple --extra-index-url https://www.piwheels.org/simple -- 'cffi>=1.3.0' requests
       cwd: None
  Complete output (99 lines):
  Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple, https://www.piwheels.org/simple
  Collecting cffi>=1.3.0
    Using cached cffi-1.15.0.tar.gz (484 kB)
  Collecting requests
    Using cached requests-2.26.0.tar.gz (104 kB)
  Collecting pycparser
    Using cached pycparser-2.21.tar.gz (170 kB)
  Collecting certifi>=2017.4.17
    Using cached certifi-2021.10.8.tar.gz (151 kB)
  Collecting urllib3<1.27,>=1.21.1
    Using cached urllib3-1.26.7.tar.gz (291 kB)
  Collecting charset_normalizer~=2.0.0
    Using cached charset-normalizer-2.0.9.tar.gz (75 kB)
  Collecting idna<4,>=2.5
    Using cached idna-3.3.tar.gz (286 kB)
  Skipping wheel build for cffi, due to binaries being disabled for it.
  Skipping wheel build for requests, due to binaries being disabled for it.
  Skipping wheel build for certifi, due to binaries being disabled for it.
  Skipping wheel build for charset-normalizer, due to binaries being disabled for it.
  Skipping wheel build for idna, due to binaries being disabled for it.
  Skipping wheel build for urllib3, due to binaries being disabled for it.
  Skipping wheel build for pycparser, due to binaries being disabled for it.
  Installing collected packages: urllib3, pycparser, idna, charset-normalizer, certifi, requests, cffi
      Running setup.py install for urllib3: started
      Running setup.py install for urllib3: finished with status 'done'
      Running setup.py install for pycparser: started
      Running setup.py install for pycparser: finished with status 'done'
      Running setup.py install for idna: started
      Running setup.py install for idna: finished with status 'done'
      Running setup.py install for charset-normalizer: started
      Running setup.py install for charset-normalizer: finished with status 'done'
      Running setup.py install for certifi: started
      Running setup.py install for certifi: finished with status 'done'
      Running setup.py install for requests: started
      Running setup.py install for requests: finished with status 'done'
      Running setup.py install for cffi: started
      Running setup.py install for cffi: finished with status 'error'
      ERROR: Command errored out with exit status 1:
       command: /home/pi/Desktop/coinopal_backer/venv/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-3x7ufre5/cffi_93f338e504bd4d83adbce135e9ba0151/setup.py'"'"'; __file__='"'"'/tmp/pip-install-3x7ufre5/cffi_93f338e504bd4d83adbce135e9ba0151/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-0fpgao7q/install-record.txt --single-version-externally-managed --prefix /tmp/pip-build-env-kwp5_uah/normal --compile --install-headers /tmp/pip-build-env-kwp5_uah/normal/include/site/python3.9/cffi
           cwd: /tmp/pip-install-3x7ufre5/cffi_93f338e504bd4d83adbce135e9ba0151/
      Complete output (56 lines):
      Package libffi was not found in the pkg-config search path.
      Perhaps you should add the directory containing `libffi.pc'
      to the PKG_CONFIG_PATH environment variable
      No package 'libffi' found
      Package libffi was not found in the pkg-config search path.
      Perhaps you should add the directory containing `libffi.pc'
      to the PKG_CONFIG_PATH environment variable
      No package 'libffi' found
      Package libffi was not found in the pkg-config search path.
      Perhaps you should add the directory containing `libffi.pc'
      to the PKG_CONFIG_PATH environment variable
      No package 'libffi' found
      Package libffi was not found in the pkg-config search path.
      Perhaps you should add the directory containing `libffi.pc'
      to the PKG_CONFIG_PATH environment variable
      No package 'libffi' found
      Package libffi was not found in the pkg-config search path.
      Perhaps you should add the directory containing `libffi.pc'
      to the PKG_CONFIG_PATH environment variable
      No package 'libffi' found
      running install
      running build
      running build_py
      creating build
      creating build/lib.linux-armv7l-3.9
      creating build/lib.linux-armv7l-3.9/cffi
      copying cffi/verifier.py -> build/lib.linux-armv7l-3.9/cffi
      copying cffi/recompiler.py -> build/lib.linux-armv7l-3.9/cffi
      copying cffi/vengine_cpy.py -> build/lib.linux-armv7l-3.9/cffi
      copying cffi/error.py -> build/lib.linux-armv7l-3.9/cffi
      copying cffi/vengine_gen.py -> build/lib.linux-armv7l-3.9/cffi
      copying cffi/backend_ctypes.py -> build/lib.linux-armv7l-3.9/cffi
      copying cffi/api.py -> build/lib.linux-armv7l-3.9/cffi
      copying cffi/setuptools_ext.py -> build/lib.linux-armv7l-3.9/cffi
      copying cffi/cffi_opcode.py -> build/lib.linux-armv7l-3.9/cffi
      copying cffi/pkgconfig.py -> build/lib.linux-armv7l-3.9/cffi
      copying cffi/lock.py -> build/lib.linux-armv7l-3.9/cffi
      copying cffi/commontypes.py -> build/lib.linux-armv7l-3.9/cffi
      copying cffi/cparser.py -> build/lib.linux-armv7l-3.9/cffi
      copying cffi/model.py -> build/lib.linux-armv7l-3.9/cffi
      copying cffi/ffiplatform.py -> build/lib.linux-armv7l-3.9/cffi
      copying cffi/__init__.py -> build/lib.linux-armv7l-3.9/cffi
      copying cffi/_cffi_include.h -> build/lib.linux-armv7l-3.9/cffi
      copying cffi/parse_c_type.h -> build/lib.linux-armv7l-3.9/cffi
      copying cffi/_embedding.h -> build/lib.linux-armv7l-3.9/cffi
      copying cffi/_cffi_errors.h -> build/lib.linux-armv7l-3.9/cffi
      running build_ext
      building '_cffi_backend' extension
      creating build/temp.linux-armv7l-3.9
      creating build/temp.linux-armv7l-3.9/c
      arm-linux-gnueabihf-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -ffile-prefix-map=/python3.9-3.9.2=. -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -ffile-prefix-map=/python3.9-3.9.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DUSE__THREAD -DHAVE_SYNC_SYNCHRONIZE -I/usr/include/ffi -I/usr/include/libffi -I/home/pi/Desktop/coinopal_backer/venv/include -I/usr/include/python3.9 -c c/_cffi_backend.c -o build/temp.linux-armv7l-3.9/c/_cffi_backend.o
      c/_cffi_backend.c:15:10: fatal error: ffi.h: No such file or directory
         15 | #include <ffi.h>
            |          ^~~~~~~
      compilation terminated.
      error: command '/usr/bin/arm-linux-gnueabihf-gcc' failed with exit code 1
      ----------------------------------------
  ERROR: Command errored out with exit status 1: /home/pi/Desktop/coinopal_backer/venv/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-3x7ufre5/cffi_93f338e504bd4d83adbce135e9ba0151/setup.py'"'"'; __file__='"'"'/tmp/pip-install-3x7ufre5/cffi_93f338e504bd4d83adbce135e9ba0151/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-0fpgao7q/install-record.txt --single-version-externally-managed --prefix /tmp/pip-build-env-kwp5_uah/normal --compile --install-headers /tmp/pip-build-env-kwp5_uah/normal/include/site/python3.9/cffi Check the logs for full command output.
  ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/49/62/742ea42846d4250c9e3503e791b2906ede13d51fae09076802d9e96f466c/coincurve-15.0.1.tar.gz#sha256=eb556b4c52827ca4b32a3b6cf86b19b848ae1cf9ab5e2bf7ed2eb05aa38aabe3 (from https://pypi.org/simple/coincurve/) (requires-python:>=3.6). Command errored out with exit status 1: /home/pi/Desktop/coinopal_backer/venv/bin/python /home/pi/Desktop/coinopal_backer/venv/lib/python3.9/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-kwp5_uah/normal --no-warn-script-location --no-binary :all: --only-binary :none: -i https://pypi.org/simple --extra-index-url https://www.piwheels.org/simple -- 'cffi>=1.3.0' requests Check the logs for full command output.
Collecting bip_utils
  Using cached bip_utils-2.0.2.tar.gz (267 kB)
  Using cached bip_utils-2.0.1.tar.gz (265 kB)
  Using cached bip_utils-2.0.0.tar.gz (404 kB)
  Using cached bip_utils-1.11.1.tar.gz (118 kB)
Requirement already satisfied: ecdsa>=0.14 in ./venv/lib/python3.9/site-packages (from bip_utils) (0.17.0)
Requirement already satisfied: pysha3 in ./venv/lib/python3.9/site-packages (from bip_utils) (1.0.2)
Requirement already satisfied: six>=1.9.0 in ./venv/lib/python3.9/site-packages (from ecdsa>=0.14->bip_utils) (1.16.0)
Skipping wheel build for bip-utils, due to binaries being disabled for it.
Installing collected packages: bip-utils
    Running setup.py install for bip-utils ... error
    ERROR: Command errored out with exit status 1:
     command: /home/pi/Desktop/coinopal_backer/venv/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-rfwwc63a/bip-utils_4ae86c1e327448d1aa199d91f2f20af0/setup.py'"'"'; __file__='"'"'/tmp/pip-install-rfwwc63a/bip-utils_4ae86c1e327448d1aa199d91f2f20af0/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-utpf6nmc/install-record.txt --single-version-externally-managed --compile --install-headers /home/pi/Desktop/coinopal_backer/venv/include/site/python3.9/bip-utils --coincurve=0
         cwd: /tmp/pip-install-rfwwc63a/bip-utils_4ae86c1e327448d1aa199d91f2f20af0/
    Complete output (6 lines):
    usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
       or: setup.py --help [cmd1 cmd2 ...]
       or: setup.py --help-commands
       or: setup.py cmd --help

    error: option --coincurve not recognized
    ----------------------------------------
ERROR: Command errored out with exit status 1: /home/pi/Desktop/coinopal_backer/venv/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-rfwwc63a/bip-utils_4ae86c1e327448d1aa199d91f2f20af0/setup.py'"'"'; __file__='"'"'/tmp/pip-install-rfwwc63a/bip-utils_4ae86c1e327448d1aa199d91f2f20af0/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-utpf6nmc/install-record.txt --single-version-externally-managed --compile --install-headers /home/pi/Desktop/coinopal_backer/venv/include/site/python3.9/bip-utils --coincurve=0 Check the logs for full command output.
ebellocchia commented 2 years ago

Hi, as far as I can see from this:

Cargo, the Rust package manager, is not installed or is not on PATH.
    This package requires Rust and Cargo to compile extensions. Install it through
    the system's package manager or via https://rustup.rs/

It's because Rust is not installed (Rust is required for the sr25519 library). If I remember correctly, a nightly or development build is required.

Regards, Emanuele

mehdiirh commented 2 years ago

Thank you so much ! This solved my problem.

Also I must have a big thanks to you Emanuele. This is such a lifesavior and awesome project.