-
Notifications
You must be signed in to change notification settings - Fork 5.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Install using pip requires rust #8105
Install using pip requires rust #8105
Comments
Looks like they require cargo now: https://github.com/pyca/cryptography/blob/master/docs/installation.rst As a non-python developer it seems a bit odd that docker-compose always uses the latest dependencies and they are not pinned? Could be the way to do things with pip, just seems a bit odd to me. |
Hi @kolaente ! In docker-compose, we can only pin dependencies we can install with pip (Python packages). We cannot manage the installation of indirect dependencies which are not Python packages. But I see the problem is in the docs, we need to update them and add rust and cargo to dependencies. |
I ran into the same issue and upgrading my pip resolved. They included some steps in the docs if that does not resolve. |
I had the same issue. I just added this export line before I install docker-compose with pip.
This is already suggested in the build failure message. This worked for me as I only build and test my project with |
The way I manage to bypass the error was installing
|
Hi, in our case we are using docker-compose in alpine based
Adding here a link to the issue on cryptography project: pyca/cryptography#5771 |
@anairamzap-mobomo I ended up doing the same as you. Apparently, |
I was able to fix it by installing the dependencies for alpine in the container before installing docker-compose. |
using the documented dependencies for alpine (now with rust)
` |
Newer versions of Alpine no longer support python-dev. You need to explicitly indicate the version you want (python2-dev or python3-dev) https://pkgs.alpinelinux.org/packages?name=python*-dev&branch=v3.13 |
FWIIW ... On Ubuntu18.4 the solutions mentioned above of pre=installing setuptools_rust, updating pip, or exporting CRYPTOGRAPHY_DONT_BUILD_RUST=1 did not work at all. What ended-up doing the trick is pinning the version of cryptography at 3.3.2; in case it helps anyone: echo "cryptography==3.3.2" > /tmp/requirements.txt
sudo pip3 install -U docker-compose -r /tmp/requirements.txt
rm /tmp/requirements.txt |
Upgrading pip3 helps as well:
You may want to use user's home or venv based installation though so that the original pip provided by the deb package is not replaced |
Newer versions of the pip package "cryptography" make use of the rust compiler when being built [1], so we will need the cargo package in order for this to be successful. This issue is primarily appearant in 32-bit ARM devices, which do not have any pre-compiled wheels they can download, so it will have to build it from source. [1]: docker/compose#8105 (comment)
I am using: |
cryptography now requires rust to compile: docker/compose#8105
- requires setuptools_rust - make - openssl-dev Relates to docker/compose#8105
- requires setuptools_rust - make - openssl-dev Relates to docker/compose#8105
Running into this issue with Rasbian Bullseye, I can overcome the issue if I install docker-compose without sudo, but ran into other issues after. |
Also had the same issue on Rasbian with a recent fresh lite install, ended up installing rust to get around the issue (not ideal at all, but for some homelab Pis easy works:
Edit: Due to an unrelated issue (Loki doesn't work on 32 bit OS) I reinstalled with the 64bit version of rasbian lite, and did not encounter this issue. |
Fix using this one # Stage 1: Build stage
FROM python:3.11-slim as compile-image
## Virtualenv setup
ENV VIRTUAL_ENV=/opt/venv
RUN python3 -m venv $VIRTUAL_ENV
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
ENV CRYPTOGRAPHY_DONT_BUILD_RUST=1
# Install necessary system dependencies for building
RUN apt-get update && \
apt-get install -y --no-install-recommends \
python3-dev \
build-essential \
libffi-dev \
libpq-dev \
gcc \
libssl-dev && \
pip install --upgrade pip && \
pip install cryptography==3.3.2 |
Description of the issue
Installing docker-compose with
pip
as per the instructions from the docs fails withIt looks like the
cryptography
dependency (now?) requires rust.Of course it would not be a problem to install the rust compiler but then it should at least be mentioned in the docs. On the other hand I don't think this is intentional, therefore the issue.
Context information (for bug reports)
Output of
docker version
Steps to reproduce the issue
Dockerfile to reproduce:
Observed result
Building the image fails with the mentioned error message.
Expected result
Building the image works without issues.
Stacktrace / full error message
https://gist.github.com/kolaente/d725fe1e4d4dbae6dadd1c649bec4a74
Additional information
Installing in a docker image
The text was updated successfully, but these errors were encountered: