1

When installing "pip3 install pycrypto" I have this error:

   creating build/lib.linux-armv7l-3.6/Crypto/Protocol
    copying lib/Crypto/Protocol/AllOrNothing.py -> build/lib.linux-armv7l-3.6/Crypto/Protocol
    copying lib/Crypto/Protocol/Chaffing.py -> build/lib.linux-armv7l-3.6/Crypto/Protocol
    copying lib/Crypto/Protocol/KDF.py -> build/lib.linux-armv7l-3.6/Crypto/Protocol
    copying lib/Crypto/Protocol/__init__.py -> build/lib.linux-armv7l-3.6/Crypto/Protocol
    creating build/lib.linux-armv7l-3.6/Crypto/PublicKey
    copying lib/Crypto/PublicKey/_slowmath.py -> build/lib.linux-armv7l-3.6/Crypto/PublicKey
    copying lib/Crypto/PublicKey/pubkey.py -> build/lib.linux-armv7l-3.6/Crypto/PublicKey
    copying lib/Crypto/PublicKey/RSA.py -> build/lib.linux-armv7l-3.6/Crypto/PublicKey
    copying lib/Crypto/PublicKey/DSA.py -> build/lib.linux-armv7l-3.6/Crypto/PublicKey
    copying lib/Crypto/PublicKey/_DSA.py -> build/lib.linux-armv7l-3.6/Crypto/PublicKey
    copying lib/Crypto/PublicKey/ElGamal.py -> build/lib.linux-armv7l-3.6/Crypto/PublicKey
    copying lib/Crypto/PublicKey/_RSA.py -> build/lib.linux-armv7l-3.6/Crypto/PublicKey
    copying lib/Crypto/PublicKey/__init__.py -> build/lib.linux-armv7l-3.6/Crypto/PublicKey
    creating build/lib.linux-armv7l-3.6/Crypto/Signature
    copying lib/Crypto/Signature/PKCS1_PSS.py -> build/lib.linux-armv7l-3.6/Crypto/Signature
    copying lib/Crypto/Signature/PKCS1_v1_5.py -> build/lib.linux-armv7l-3.6/Crypto/Signature
    copying lib/Crypto/Signature/__init__.py -> build/lib.linux-armv7l-3.6/Crypto/Signature
    warning: PCTBuildPy: byte-compiling is disabled, skipping.

    running build_ext
    running build_configure
    checking for gcc... gcc
    checking whether the C compiler works... yes
    checking for C compiler default output file name... a.out
    checking for suffix of executables...
    checking whether we are cross compiling... configure: error: in `/tmp/pip-build-71pdfh2i/pycrypto':
    configure: error: cannot run C compiled programs.
    If you meant to cross compile, use `--host'.
    See `config.log' for more details
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-71pdfh2i/pycrypto/setup.py", line 456, in <module>
        core.setup(**kw)
      File "/core.py", line 148, in setup
      File "/dist.py", line 955, in run_commands
      File "/dist.py", line 974, in run_command
      File "/opt/lib/python3.6/site-packages/setuptools/command/install.py", line 61, in run
        return orig.install.run(self)
      File "/install.py", line 545, in run
      File "/cmd.py", line 313, in run_command
      File "/dist.py", line 974, in run_command
      File "/build.py", line 135, in run
      File "/cmd.py", line 313, in run_command
      File "/dist.py", line 974, in run_command
      File "/tmp/pip-build-71pdfh2i/pycrypto/setup.py", line 251, in run
        self.run_command(cmd_name)
      File "/cmd.py", line 313, in run_command
      File "/dist.py", line 974, in run_command
      File "/tmp/pip-build-71pdfh2i/pycrypto/setup.py", line 278, in run
        raise RuntimeError("autoconf error")
    RuntimeError: autoconf error

    ----------------------------------------
Command "/opt/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-71pdfh2i/pycrypto/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-cbi74gir-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-71pdfh2i/pycrypto/

My mount:

root@router2:~# mount
/dev/root on / type squashfs (ro,relatime)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
ramfs on /tmp type ramfs (rw,relatime)
none on /dev type tmpfs (rw,relatime,size=512K)
devpts on /dev/pts type devpts (rw,relatime,mode=600)
devpts on /proc/bus/usb type usbfs (rw,relatime)
/dev/sda1 on /opt type ext4 (rw,relatime,data=ordered)
/dev/sda1 on /tmp/mnt/sda1 type ext4 (rw,relatime,data=ordered)

When using TMPDIR=/opt/tmp pip3 install pycrypto I also have problem (google showed that TMPDIR must be mounted without "noexec"):

    creating build/lib.linux-armv7l-3.6/Crypto/PublicKey
    copying lib/Crypto/PublicKey/pubkey.py -> build/lib.linux-armv7l-3.6/Crypto/PublicKey
    copying lib/Crypto/PublicKey/_RSA.py -> build/lib.linux-armv7l-3.6/Crypto/PublicKey
    copying lib/Crypto/PublicKey/_DSA.py -> build/lib.linux-armv7l-3.6/Crypto/PublicKey
    copying lib/Crypto/PublicKey/_slowmath.py -> build/lib.linux-armv7l-3.6/Crypto/PublicKey
    copying lib/Crypto/PublicKey/RSA.py -> build/lib.linux-armv7l-3.6/Crypto/PublicKey
    copying lib/Crypto/PublicKey/DSA.py -> build/lib.linux-armv7l-3.6/Crypto/PublicKey
    copying lib/Crypto/PublicKey/__init__.py -> build/lib.linux-armv7l-3.6/Crypto/PublicKey
    copying lib/Crypto/PublicKey/ElGamal.py -> build/lib.linux-armv7l-3.6/Crypto/PublicKey
    creating build/lib.linux-armv7l-3.6/Crypto/Signature
    copying lib/Crypto/Signature/PKCS1_v1_5.py -> build/lib.linux-armv7l-3.6/Crypto/Signature
    copying lib/Crypto/Signature/PKCS1_PSS.py -> build/lib.linux-armv7l-3.6/Crypto/Signature
    copying lib/Crypto/Signature/__init__.py -> build/lib.linux-armv7l-3.6/Crypto/Signature
    warning: PCTBuildPy: byte-compiling is disabled, skipping.

    running build_ext
    running build_configure
    checking for gcc... gcc
    checking whether the C compiler works... yes
    checking for C compiler default output file name... a.out
    checking for suffix of executables...
    checking whether we are cross compiling... configure: error: in `/opt/tmp/pip-build-ve5o0p9a/pycrypto':
    configure: error: cannot run C compiled programs.
    If you meant to cross compile, use `--host'.
    See `config.log' for more details
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/opt/tmp/pip-build-ve5o0p9a/pycrypto/setup.py", line 456, in <module>
        core.setup(**kw)
      File "/core.py", line 148, in setup
      File "/dist.py", line 955, in run_commands
      File "/dist.py", line 974, in run_command
      File "/opt/lib/python3.6/site-packages/setuptools/command/install.py", line 61, in run
        return orig.install.run(self)
      File "/install.py", line 545, in run
      File "/cmd.py", line 313, in run_command
      File "/dist.py", line 974, in run_command
      File "/build.py", line 135, in run
      File "/cmd.py", line 313, in run_command
      File "/dist.py", line 974, in run_command
      File "/opt/tmp/pip-build-ve5o0p9a/pycrypto/setup.py", line 251, in run
        self.run_command(cmd_name)
      File "/cmd.py", line 313, in run_command
      File "/dist.py", line 974, in run_command
      File "/opt/tmp/pip-build-ve5o0p9a/pycrypto/setup.py", line 278, in run
        raise RuntimeError("autoconf error")
    RuntimeError: autoconf error

    ----------------------------------------
Command "/opt/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/opt/tmp/pip-build-ve5o0p9a/pycrypto/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /opt/tmp/pip-xa11ohvn-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /opt/tmp/pip-build-ve5o0p9a/pycrypto/

gcc, autoconf, automake, python3-dev, python3-pip, python-crypto, python-cryptography were installed.

opkg install gcc, autoconf automake python3-dev, python3-pip, python-crypto, python-cryptography

I tried set HOME=/opt/tmp and TMPDIR=/opt/tmp or HOME=/opt/tmp TMPDIR=/opt/tmp pip3 install pycrypto but the problem is the same as above.

I read https://github.com/Entware-ng/Entware-ng/wiki/Self-installation-of-python-modules and follow it but wasn't successful.

pycrypto is requirement xiaomi component of hass Please note that this is for python 3 not python 2.

Platform:
Buffalo WZR-1750DHP
Firmware: DD-WRT v3.0-r33006 std (08/03/17)

Please advise how to fix this issue.

Thank you!

Diamond
  • 175
  • 1
  • 2
  • 14
  • 1
    I think you have problem where compiler try build binary for your platform. You already check this instructions? https://github.com/Entware-ng/Entware-ng/wiki/Using-gcc-%28native-compilation%29 – erroia Aug 11 '17 at 05:13
  • 1
    There should be a `config.log` file left behind which contains the actual error message. Please include that in your question. – Florian Weimer Aug 11 '17 at 06:00
  • Thanks, after install packages and source /opt/bin/gcc_env.sh. I was able to pip3 install pycypto. – Diamond Aug 11 '17 at 13:17

0 Answers0