安装“pip3 install pycrypto”时出现此错误:
<com.example.stackoverflow.MyView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="17dp"
...
/>
我的坐骑:
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/
使用TMPDIR = / opt / tmp时pip3安装pycrypto我也有问题(google显示必须安装TMPDIR而不使用“noexec”):
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)
安装了gcc,autoconf,automake,python3-dev,python3-pip,python-crypto,python-cryptography。
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/
我尝试设置HOME = / opt / tmp和TMPDIR = / opt / tmp 或HOME = / opt / tmp TMPDIR = / opt / tmp pip3安装pycrypto 但问题与上述相同。
我读了https://github.com/Entware-ng/Entware-ng/wiki/Self-installation-of-python-modules并关注它但没有成功。
pycrypto是xiaomi component的要求hass 请注意,这是针对python 3而不是python 2。
opkg install gcc, autoconf automake python3-dev, python3-pip, python-crypto, python-cryptography
请告知如何解决此问题。
谢谢!