Is there a package for Alpine which allows me to install PyCrypto for Python 3?
After encountering problems with pip3 install pycrypto
, I stumbled upon this post which explains how to install numpy in Alpine using apk add py-numpy@testing
. PyCrypto can also be installed for Python2.7 using apk add py-crypto
. However, I cannot seem to figure out how to call pycrypto for Python3 or even if this package exists.
As an alternative solution, I tried to install the C compiler gcc using apk add gcc
so that the setup tools in pip3 install pycrypto
can compile. But, when I run that command with gcc already, it throws a fatal error:
...
running build_ext
running build_configure
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in `/tmp/pip-build-2TivSm/pycrypto':
configure: error: C compiler cannot create executables
...
Is there no way to compile Python3 modules inside Alpine?
PyCrypto is written and tested using Python version 2.1 through 3.3. Python 1.5. 2 is not supported. The modules are packaged using the Distutils, so you can simply run “python setup.py build” to build the package, and “python setup.py install” to install it.
PyCryptodome is a self-contained Python package of low-level cryptographic primitives. It supports Python 2.7, Python 3.5 and newer, and PyPy. You can install it with: pip install pycryptodome. All modules are installed under the Crypto package.
This worked for me:
apk add gcc g++ make libffi-dev openssl-dev
Then do your pip install.
configure: error: C compiler cannot create executables
In alpine Install their SDK.
For any compiling stuff in Alpine, make sure you have these packages.
alpine-sdk autoconf automake libtool
Install it apk add --no-cache alpine-sdk autoconf automake libtool
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With