pyca / pynacl

Python binding to the Networking and Cryptography (NaCl) library
https://pynacl.readthedocs.io/
Apache License 2.0
1.08k stars 232 forks source link

Error when building on termux #483

Open Ublimjo opened 6 years ago

Ublimjo commented 6 years ago
Collecting pynacl
  Using cached https://files.pythonhosted.org/packages/61/ab/2ac6dea8489fa713e2b4c6c5b549cc962dd4a842b5998d9e80cf8440b7cd/PyNaCl-1.3.0.tar.gz
  Installing build dependencies ... done
Requirement already satisfied: six in /data/data/com.termux/files/usr/lib/python2.7/site-packages (from pynacl) (1.11.0)
Requirement already satisfied: cffi>=1.4.1 in /data/data/com.termux/files/usr/lib/python2.7/site-packages (from pynacl) (1.11.5)
Requirement already satisfied: pycparser in /data/data/com.termux/files/usr/lib/python2.7/site-packages (from cffi>=1.4.1->pynacl) (2.19)
Installing collected packages: pynacl
  Running setup.py install for pynacl ... error
    Complete output from command /data/data/com.termux/files/usr/bin/python2 -u -c "import setuptools, tokenize;__file__='/data/data/com.termux/files/usr/tmp/pip-install-VHEk2A/pynacl/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /data/data/com.termux/files/usr/tmp/pip-record-3NttdJ/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-i686-2.7
    creating build/lib.linux-i686-2.7/nacl
    copying src/nacl/__init__.py -> build/lib.linux-i686-2.7/nacl
    copying src/nacl/encoding.py -> build/lib.linux-i686-2.7/nacl
    copying src/nacl/exceptions.py -> build/lib.linux-i686-2.7/nacl
    copying src/nacl/hash.py -> build/lib.linux-i686-2.7/nacl
    copying src/nacl/hashlib.py -> build/lib.linux-i686-2.7/nacl
    copying src/nacl/public.py -> build/lib.linux-i686-2.7/nacl
    copying src/nacl/secret.py -> build/lib.linux-i686-2.7/nacl
    copying src/nacl/signing.py -> build/lib.linux-i686-2.7/nacl
    copying src/nacl/utils.py -> build/lib.linux-i686-2.7/nacl
    creating build/lib.linux-i686-2.7/nacl/pwhash
    copying src/nacl/pwhash/__init__.py -> build/lib.linux-i686-2.7/nacl/pwhash
    copying src/nacl/pwhash/_argon2.py -> build/lib.linux-i686-2.7/nacl/pwhash
    copying src/nacl/pwhash/argon2i.py -> build/lib.linux-i686-2.7/nacl/pwhash
    copying src/nacl/pwhash/argon2id.py -> build/lib.linux-i686-2.7/nacl/pwhash
    copying src/nacl/pwhash/scrypt.py -> build/lib.linux-i686-2.7/nacl/pwhash
    creating build/lib.linux-i686-2.7/nacl/bindings
    copying src/nacl/bindings/__init__.py -> build/lib.linux-i686-2.7/nacl/bindings
    copying src/nacl/bindings/crypto_aead.py -> build/lib.linux-i686-2.7/nacl/bindings
    copying src/nacl/bindings/crypto_box.py -> build/lib.linux-i686-2.7/nacl/bindings
    copying src/nacl/bindings/crypto_generichash.py -> build/lib.linux-i686-2.7/nacl/bindings
    copying src/nacl/bindings/crypto_hash.py -> build/lib.linux-i686-2.7/nacl/bindings
    copying src/nacl/bindings/crypto_kx.py -> build/lib.linux-i686-2.7/nacl/bindings
    copying src/nacl/bindings/crypto_pwhash.py -> build/lib.linux-i686-2.7/nacl/bindings
    copying src/nacl/bindings/crypto_scalarmult.py -> build/lib.linux-i686-2.7/nacl/bindings
    copying src/nacl/bindings/crypto_secretbox.py -> build/lib.linux-i686-2.7/nacl/bindings
    copying src/nacl/bindings/crypto_secretstream.py -> build/lib.linux-i686-2.7/nacl/bindings
    copying src/nacl/bindings/crypto_shorthash.py -> build/lib.linux-i686-2.7/nacl/bindings
    copying src/nacl/bindings/crypto_sign.py -> build/lib.linux-i686-2.7/nacl/bindings
    copying src/nacl/bindings/randombytes.py -> build/lib.linux-i686-2.7/nacl/bindings
    copying src/nacl/bindings/sodium_core.py -> build/lib.linux-i686-2.7/nacl/bindings
    copying src/nacl/bindings/utils.py -> build/lib.linux-i686-2.7/nacl/bindings
    running build_clib
    error: [Errno 2] No such file or directory
    ----------------------------------------
Command "/data/data/com.termux/files/usr/bin/python2 -u -c "import setuptools, tokenize;__file__='/data/data/com.termux/files/usr/tmp/pip-install-VHEk2A/pynacl/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /data/data/com.termux/files/usr/tmp/pip-record-3NttdJ/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /data/data/com.termux/files/usr/tmp/pip-install-VHEk2A/pynacl/
reaperhulk commented 6 years ago

Do you have make available? That error is likely due to attempting to invoke make without it being present in $PATH

Ublimjo commented 6 years ago

Yes, I have make

lmctv commented 6 years ago

@Ublimjo I think you are really trying to cross-build; in this case the make command (and a local build system) must be available in the same environment of the termux python interpreter;

Ublimjo commented 6 years ago

@lmctv what should I do ?

lmctv commented 6 years ago

Pynacl bindings depend on python cffi, and inherit it's dependence on a working build environment; at this time we don't have ready to follow recipes for cross building, other than a generic suggestion to run the build in a native or fully emulated environment, whose resulting wheel should correctly work also without the build environment.

QJKX commented 5 years ago

FWIW I've had success compiling pynacl in termux with Python3 (I've not tried with python 2.7 which you are using.)

ashwinvis commented 5 years ago

This works too:

$ pkg install clang python-dev libffi-dev openssl-dev libsodium-dev
$ SODIUM_INSTALL=system pip install pynacl
MadWolfBY commented 4 years ago

Today (2020) works this: $ pkg install clang python libffi openssl libsodium $ SODIUM_INSTALL=system pip install pynacl

meinkonho commented 4 years ago

@MadWolfBY thank buddy its worked

piyx commented 3 years ago

Today (2020) works this: $ pkg install clang python libffi openssl libsodium $ SODIUM_INSTALL=system pip install pynacl

This worked! Thanks!

ced123-cloud commented 3 years ago

very thanks

gamersekofy commented 3 years ago

This works too:

$ pkg install clang python-dev libffi-dev openssl-dev libsodium-dev
$ SODIUM_INSTALL=system pip install pynacl

THANK YOU SO MUCH!! THAT WORKED!

somu1795 commented 2 years ago

Today (2020) works this: $ pkg install clang python libffi openssl libsodium $ SODIUM_INSTALL=system pip install pynacl

Many thanks

Zandruk40 commented 11 months ago

Today (2020) works this: $ pkg install clang python libffi openssl libsodium $ SODIUM_INSTALL=system pip install pynacl

Good work