title: ERROR: No matching distribution found for cryptography==3.2.1
body: <p>I'm trying to install  cryptography==3.2.1 to my django project but I got this error</p>
  <pre><code>Collecting cryptography==3.2.1
    Downloading cryptography-3.2.1.tar.gz (540 kB)
    Installing build dependencies: started
    Installing build dependencies: finished with status 'error'
    ERROR: Command errored out with exit status 1:
     command: /usr/local/bin/python /usr/local/lib/python3.10/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-5acxrfz0/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools&gt;=40.6.0' wheel 'cffi&gt;=1.8,!=1.11.3; platform_python_implementation != '&quot;'&quot;'PyPy'&quot;'&quot;''
         cwd: None
    Complete output (122 lines):
    Collecting setuptools&gt;=40.6.0
      Downloading setuptools-54.1.1-py3-none-any.whl (784 kB)
    Collecting wheel
      Downloading wheel-0.36.2-py2.py3-none-any.whl (35 kB)
    Collecting cffi!=1.11.3,&gt;=1.8
      Downloading cffi-1.14.5.tar.gz (475 kB)
    Collecting pycparser
      Downloading pycparser-2.20-py2.py3-none-any.whl (112 kB)
    Building wheels for collected packages: cffi
      Building wheel for cffi (setup.py): started
      Building wheel for cffi (setup.py): finished with status 'error'
      ERROR: Command errored out with exit status 1:
       command: /usr/local/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '&quot;'&quot;'/tmp/pip-install-p5wjmnwg/cffi_4138eef598d743ef92d64bbc9e0b8ac5/setup.py'&quot;'&quot;'; __file__='&quot;'&quot;'/tmp/pip-install-p5wjmnwg/cffi_4138eef598d743ef92d64bbc9e0b8ac5/setup.py'&quot;'&quot;';f=getattr(tokenize, '&quot;'&quot;'open'&quot;'&quot;', open)(__file__);code=f.read().replace('&quot;'&quot;'\r\n'&quot;'&quot;', '&quot;'&quot;'\n'&quot;'&quot;');f.close();exec(compile(code, __file__, '&quot;'&quot;'exec'&quot;'&quot;'))' bdist_wheel -d /tmp/pip-wheel-h86bujlk
           cwd: /tmp/pip-install-p5wjmnwg/cffi_4138eef598d743ef92d64bbc9e0b8ac5/
      Complete output (47 lines):
    
          No working compiler found, or bogus compiler options passed to
          the compiler from Python's standard &quot;distutils&quot; module.  See
          the error messages above.  Likely, the problem is not related
          to CFFI but generic to the setup.py of any Python package that
          tries to compile C code.  (Hints: on OS/X 10.8, for errors about
          -mno-fused-madd see http://stackoverflow.com/questions/22313407/
          Otherwise, see https://wiki.python.org/moin/CompLangPython or
          the IRC channel #python on irc.freenode.net.)
    
          Trying to continue anyway.  If you are trying to install CFFI from
          a build done in a different context, you can ignore this warning.
    
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-3.10
      creating build/lib.linux-x86_64-3.10/cffi
      copying cffi/api.py -&gt; build/lib.linux-x86_64-3.10/cffi
      copying cffi/vengine_cpy.py -&gt; build/lib.linux-x86_64-3.10/cffi
      copying cffi/cffi_opcode.py -&gt; build/lib.linux-x86_64-3.10/cffi
      copying cffi/backend_ctypes.py -&gt; build/lib.linux-x86_64-3.10/cffi
      copying cffi/setuptools_ext.py -&gt; build/lib.linux-x86_64-3.10/cffi
      copying cffi/ffiplatform.py -&gt; build/lib.linux-x86_64-3.10/cffi
      copying cffi/cparser.py -&gt; build/lib.linux-x86_64-3.10/cffi
      copying cffi/verifier.py -&gt; build/lib.linux-x86_64-3.10/cffi
      copying cffi/vengine_gen.py -&gt; build/lib.linux-x86_64-3.10/cffi
      copying cffi/lock.py -&gt; build/lib.linux-x86_64-3.10/cffi
      copying cffi/commontypes.py -&gt; build/lib.linux-x86_64-3.10/cffi
      copying cffi/model.py -&gt; build/lib.linux-x86_64-3.10/cffi
      copying cffi/error.py -&gt; build/lib.linux-x86_64-3.10/cffi
      copying cffi/recompiler.py -&gt; build/lib.linux-x86_64-3.10/cffi
      copying cffi/pkgconfig.py -&gt; build/lib.linux-x86_64-3.10/cffi
      copying cffi/__init__.py -&gt; build/lib.linux-x86_64-3.10/cffi
      copying cffi/_cffi_include.h -&gt; build/lib.linux-x86_64-3.10/cffi
      copying cffi/parse_c_type.h -&gt; build/lib.linux-x86_64-3.10/cffi
      copying cffi/_embedding.h -&gt; build/lib.linux-x86_64-3.10/cffi
      copying cffi/_cffi_errors.h -&gt; build/lib.linux-x86_64-3.10/cffi
      warning: build_py: byte-compiling is disabled, skipping.
    
      running build_ext
      building '_cffi_backend' extension
      creating build/temp.linux-x86_64-3.10
      creating build/temp.linux-x86_64-3.10/c
      gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -DTHREAD_STACK_SIZE=0x100000 -fPIC -I/usr/include/ffi -I/usr/include/libffi -I/usr/local/include/python3.10 -c c/_cffi_backend.c -o build/temp.linux-x86_64-3.10/c/_cffi_backend.o
      error: command 'gcc' failed: No such file or directory
      ----------------------------------------
      ERROR: Failed building wheel for cffi
      Running setup.py clean for cffi
    Failed to build cffi
    Installing collected packages: pycparser, wheel, setuptools, cffi
        Running setup.py install for cffi: started
        Running setup.py install for cffi: finished with status 'error'
        ERROR: Command errored out with exit status 1:
         command: /usr/local/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '&quot;'&quot;'/tmp/pip-install-p5wjmnwg/cffi_4138eef598d743ef92d64bbc9e0b8ac5/setup.py'&quot;'&quot;'; __file__='&quot;'&quot;'/tmp/pip-install-p5wjmnwg/cffi_4138eef598d743ef92d64bbc9e0b8ac5/setup.py'&quot;'&quot;';f=getattr(tokenize, '&quot;'&quot;'open'&quot;'&quot;', open)(__file__);code=f.read().replace('&quot;'&quot;'\r\n'&quot;'&quot;', '&quot;'&quot;'\n'&quot;'&quot;');f.close();exec(compile(code, __file__, '&quot;'&quot;'exec'&quot;'&quot;'))' install --record /tmp/pip-record-sx_wm_b2/install-record.txt --single-version-externally-managed --prefix /tmp/pip-build-env-5acxrfz0/overlay --compile --install-headers /tmp/pip-build-env-5acxrfz0/overlay/include/python3.10/cffi
             cwd: /tmp/pip-install-p5wjmnwg/cffi_4138eef598d743ef92d64bbc9e0b8ac5/
        Complete output (47 lines):
    
            No working compiler found, or bogus compiler options passed to
            the compiler from Python's standard &quot;distutils&quot; module.  See
            the error messages above.  Likely, the problem is not related
            to CFFI but generic to the setup.py of any Python package that
            tries to compile C code.  (Hints: on OS/X 10.8, for errors about
            -mno-fused-madd see http://stackoverflow.com/questions/22313407/
            Otherwise, see https://wiki.python.org/moin/CompLangPython or
            the IRC channel #python on irc.freenode.net.)
    
            Trying to continue anyway.  If you are trying to install CFFI from
            a build done in a different context, you can ignore this warning.
    
        running install
        running build
        running build_py
        creating build
        creating build/lib.linux-x86_64-3.10
        creating build/lib.linux-x86_64-3.10/cffi
        copying cffi/api.py -&gt; build/lib.linux-x86_64-3.10/cffi
        copying cffi/vengine_cpy.py -&gt; build/lib.linux-x86_64-3.10/cffi
        copying cffi/cffi_opcode.py -&gt; build/lib.linux-x86_64-3.10/cffi
        copying cffi/backend_ctypes.py -&gt; build/lib.linux-x86_64-3.10/cffi
        copying cffi/setuptools_ext.py -&gt; build/lib.linux-x86_64-3.10/cffi
        copying cffi/ffiplatform.py -&gt; build/lib.linux-x86_64-3.10/cffi
        copying cffi/cparser.py -&gt; build/lib.linux-x86_64-3.10/cffi
        copying cffi/verifier.py -&gt; build/lib.linux-x86_64-3.10/cffi
        copying cffi/vengine_gen.py -&gt; build/lib.linux-x86_64-3.10/cffi
        copying cffi/lock.py -&gt; build/lib.linux-x86_64-3.10/cffi
        copying cffi/commontypes.py -&gt; build/lib.linux-x86_64-3.10/cffi
        copying cffi/model.py -&gt; build/lib.linux-x86_64-3.10/cffi
        copying cffi/error.py -&gt; build/lib.linux-x86_64-3.10/cffi
        copying cffi/recompiler.py -&gt; build/lib.linux-x86_64-3.10/cffi
        copying cffi/pkgconfig.py -&gt; build/lib.linux-x86_64-3.10/cffi
        copying cffi/__init__.py -&gt; build/lib.linux-x86_64-3.10/cffi
        copying cffi/_cffi_include.h -&gt; build/lib.linux-x86_64-3.10/cffi
        copying cffi/parse_c_type.h -&gt; build/lib.linux-x86_64-3.10/cffi
        copying cffi/_embedding.h -&gt; build/lib.linux-x86_64-3.10/cffi
        copying cffi/_cffi_errors.h -&gt; build/lib.linux-x86_64-3.10/cffi
        warning: build_py: byte-compiling is disabled, skipping.
    
        running build_ext
        building '_cffi_backend' extension
        creating build/temp.linux-x86_64-3.10
        creating build/temp.linux-x86_64-3.10/c
        gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -DTHREAD_STACK_SIZE=0x100000 -fPIC -I/usr/include/ffi -I/usr/include/libffi -I/usr/local/include/python3.10 -c c/_cffi_backend.c -o build/temp.linux-x86_64-3.10/c/_cffi_backend.o
        error: command 'gcc' failed: No such file or directory
        ----------------------------------------
    ERROR: Command errored out with exit status 1: /usr/local/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '&quot;'&quot;'/tmp/pip-install-p5wjmnwg/cffi_4138eef598d743ef92d64bbc9e0b8ac5/setup.py'&quot;'&quot;'; __file__='&quot;'&quot;'/tmp/pip-install-p5wjmnwg/cffi_4138eef598d743ef92d64bbc9e0b8ac5/setup.py'&quot;'&quot;';f=getattr(tokenize, '&quot;'&quot;'open'&quot;'&quot;', open)(__file__);code=f.read().replace('&quot;'&quot;'\r\n'&quot;'&quot;', '&quot;'&quot;'\n'&quot;'&quot;');f.close();exec(compile(code, __file__, '&quot;'&quot;'exec'&quot;'&quot;'))' install --record /tmp/pip-record-sx_wm_b2/install-record.txt --single-version-externally-managed --prefix /tmp/pip-build-env-5acxrfz0/overlay --compile --install-headers /tmp/pip-build-env-5acxrfz0/overlay/include/python3.10/cffi Check the logs for full command output.
    ----------------------------------------
  WARNING: Discarding https://files.pythonhosted.org/packages/94/5c/42de91c7fbdb817b2d9a4e64b067946eb38a4eb36c1a09c96c87a0f86a82/cryptography-3.2.1.tar.gz#sha256=d3d5e10be0cf2a12214ddee45c6bd203dab435e3d83b4560c03066eda600bfe3 (from https://pypi.org/simple/cryptography/) (requires-python:&gt;=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*). Command errored out with exit status 1: /usr/local/bin/python /usr/local/lib/python3.10/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-5acxrfz0/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools&gt;=40.6.0' wheel 'cffi&gt;=1.8,!=1.11.3; platform_python_implementation != '&quot;'&quot;'PyPy'&quot;'&quot;'' Check the logs for full command output.
  ERROR: Could not find a version that satisfies the requirement cryptography==3.2.1
  ERROR: No matching distribution found for cryptography==3.2.1
  ERROR: Service 'web' failed to build : The command '/bin/sh -c pip install --upgrade pip     &amp;&amp; pip install -r requirements.txt     &amp;&amp; chmod +x docker-entrypoint.sh' returned a non-zero code: 1
  </code></pre>
  <p>base image docker file content built with tag <code>python3.10-alpine:base</code></p>
  <pre><code>FROM python:3.10.0a6-alpine3.13
  ENV PYTHONUNBUFFERED 1
  RUN apk add --no-cache --virtual .build-deps \
      ca-certificates gcc postgresql-dev linux-headers musl-dev openssl-dev cargo  ffmpeg \
      libffi-dev jpeg-dev zlib-dev python3-dev    py3-cryptography \
  #    &amp;&amp; pip install psycopg2==2.8.1 Pillow==6.0.0 \
      &amp;&amp; find /usr/local \
          \( -type d -a -name test -o -name tests \) \
          -o \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \
          -exec rm -rf '{}' + \
      &amp;&amp; runDeps=&quot;$( \
          scanelf --needed --nobanner --recursive /usr/local \
                  | awk '{ gsub(/,/, &quot;\nso:&quot;, $2); print &quot;so:&quot; $2 }' \
                  | sort -u \
                  | xargs -r apk info --installed \
                  | sort -u \
      )&quot; \
      &amp;&amp; apk add --virtual .rundeps $runDeps \
      &amp;&amp; apk del .build-deps
  </code></pre>
  <p>my project Dockerfile</p>
  <pre><code>FROM python3.10-alpine:base
  
  # set work directory
  ENV APP_PATH /usr/src/src/
  # set environment variables
  ENV PYTHONDONTWRITEBYTECODE 1
  ENV PYTHONUNBUFFERED 1
  
  WORKDIR $APP_PATH
  
  
  
  ## install dependencies
  #COPY ./src .
  
  # py-cryptography is required
  COPY requirements.txt docker-entrypoint.sh $APP_PATH
  
  RUN pip install --upgrade pip \
      &amp;&amp; pip install -r requirements.txt \
      &amp;&amp; chmod +x docker-entrypoint.sh
  # RUN apt update \
  #    &amp;&amp; apk add gcc musl-dev python3-dev libffi-dev openssl-dev cargo jpeg-dev zlib-dev  ffmpeg \
  #    &amp;&amp; pip install --upgrade pip \
  #    &amp;&amp; pip install -r requirements.txt \
  #    &amp;&amp; chmod +x docker-entrypoint.sh
  
  # copy project
  COPY . .
  </code></pre>