Uploaded image for project: 'Python Driver'
  1. Python Driver
  2. PYTHON-3026

Test Failure - Windows Python 3.6 fails to install cryptography

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.1, 4.0.2
    • Affects Version/s: None
    • Component/s: Tests
    • None

      Windows Python 3.6 fails to install cryptography. I suspect the problem is that the version of pip is too old to install the cryptography wheels. Another option might be to down grade to use pyopenssl 20. For example:

       [2021/11/30 01:03:58.601] + PYTHON=C:/python/Python36/python.exe
       [2021/11/30 01:03:58.601] + '[' -n 1 ']'
       [2021/11/30 01:03:58.601] + createvirtualenv C:/python/Python36/python.exe pyopenssltest
       [2021/11/30 01:03:58.601] + PYTHON=C:/python/Python36/python.exe
       [2021/11/30 01:03:58.601] + VENVPATH=pyopenssltest
       [2021/11/30 01:03:58.601] + C:/python/Python36/python.exe -m venv -h
       [2021/11/30 01:03:58.714] + VIRTUALENV='C:/python/Python36/python.exe -m venv'
       [2021/11/30 01:03:58.714] + C:/python/Python36/python.exe -m venv pyopenssltest
       [2021/11/30 01:04:02.895] + '[' Windows_NT = Windows_NT ']'
       [2021/11/30 01:04:02.895] + dos2unix pyopenssltest/Scripts/activate
       [2021/11/30 01:04:02.896] dos2unix: converting file pyopenssltest/Scripts/activate to Unix format...
       [2021/11/30 01:04:02.896] + . pyopenssltest/Scripts/activate
       [2021/11/30 01:04:02.897] ++ deactivate nondestructive
       [2021/11/30 01:04:02.897] ++ '[' -n '' ']'
       [2021/11/30 01:04:02.897] ++ '[' -n '' ']'
       [2021/11/30 01:04:02.897] ++ '[' -n /usr/bin/bash -o -n '' ']'
       [2021/11/30 01:04:02.897] ++ hash -r
       [2021/11/30 01:04:02.897] ++ '[' -n '' ']'
       [2021/11/30 01:04:02.897] ++ unset VIRTUAL_ENV
       [2021/11/30 01:04:02.897] ++ '[' '!' nondestructive = nondestructive ']'
       [2021/11/30 01:04:02.897] ++ VIRTUAL_ENV='C:\data\mci\c4d24bf371b7ccd06f6e4fae90d21496\src\pyopenssltest'
       [2021/11/30 01:04:02.897] ++ export VIRTUAL_ENV
      ...
       [2021/11/30 01:04:02.944] + python -m pip install --prefer-binary pyopenssl requests service_identity
       [2021/11/30 01:04:03.629] Collecting pyopenssl
       [2021/11/30 01:04:03.629]   Using cached https://files.pythonhosted.org/packages/85/3a/fe3c98435856a1ed798977981f3da82d2685cf9df97e4d9546340d2b83db/pyOpenSSL-21.0.0-py2.py3-none-any.whl
       [2021/11/30 01:04:03.729] Collecting requests
       [2021/11/30 01:04:03.729]   Using cached https://files.pythonhosted.org/packages/92/96/144f70b972a9c0eabbd4391ef93ccd49d0f2747f4f6a2a2738e99e5adc65/requests-2.26.0-py2.py3-none-any.whl
       [2021/11/30 01:04:03.791] Collecting service_identity
       [2021/11/30 01:04:03.791]   Using cached https://files.pythonhosted.org/packages/93/5a/5e93f280ec7be676b5a57f305350f439d31ced168bca04e6ffa64b575664/service_identity-21.1.0-py2.py3-none-any.whl
       [2021/11/30 01:04:04.183] Collecting cryptography>=3.3 (from pyopenssl)
       [2021/11/30 01:04:04.183]   Downloading https://files.pythonhosted.org/packages/60/06/d9109aba62c0b42466195e5b9b30dded26621a675b73998218070d8cc637/cryptography-36.0.0.tar.gz (571kB)
       [2021/11/30 01:04:07.975]   Installing build dependencies: started
       [2021/11/30 01:04:09.097]   Installing build dependencies: finished with status 'done'
       [2021/11/30 01:04:09.128] Collecting six>=1.5.2 (from pyopenssl)
       [2021/11/30 01:04:09.128]   Using cached https://files.pythonhosted.org/packages/d9/5a/e7c31adbe875f2abbb91bd84cf2dc52d792b5a01506781dbcf25c91daf11/six-1.16.0-py2.py3-none-any.whl
       [2021/11/30 01:04:09.202] Collecting urllib3<1.27,>=1.21.1 (from requests)
       [2021/11/30 01:04:09.202]   Using cached https://files.pythonhosted.org/packages/af/f4/524415c0744552cce7d8bf3669af78e8a069514405ea4fcbd0cc44733744/urllib3-1.26.7-py2.py3-none-any.whl
       [2021/11/30 01:04:09.289] Collecting certifi>=2017.4.17 (from requests)
       [2021/11/30 01:04:09.289]   Using cached https://files.pythonhosted.org/packages/37/45/946c02767aabb873146011e665728b680884cd8fe70dde973c640e45b775/certifi-2021.10.8-py2.py3-none-any.whl
       [2021/11/30 01:04:09.340] Collecting charset-normalizer~=2.0.0; python_version >= "3" (from requests)
       [2021/11/30 01:04:09.340]   Using cached https://files.pythonhosted.org/packages/c8/27/141554fc0f42c05dd318fbb0be0e3e018da686544a3ff452762e49ccac58/charset_normalizer-2.0.8-py3-none-any.whl
       [2021/11/30 01:04:09.394] Collecting idna<4,>=2.5; python_version >= "3" (from requests)
       [2021/11/30 01:04:09.394]   Using cached https://files.pythonhosted.org/packages/04/a2/d918dcd22354d8958fe113e1a3630137e0fc8b44859ade3063982eacd2a4/idna-3.3-py3-none-any.whl
       [2021/11/30 01:04:09.481] Collecting pyasn1 (from service_identity)
       [2021/11/30 01:04:09.481]   Using cached https://files.pythonhosted.org/packages/62/1e/a94a8d635fa3ce4cfc7f506003548d0a2447ae76fd5ca53932970fe3053f/pyasn1-0.4.8-py2.py3-none-any.whl
       [2021/11/30 01:04:09.570] Collecting pyasn1-modules (from service_identity)
       [2021/11/30 01:04:09.570]   Using cached https://files.pythonhosted.org/packages/95/de/214830a981892a3e286c3794f41ae67a4495df1108c3da8a9f62159b9a9d/pyasn1_modules-0.2.8-py2.py3-none-any.whl
       [2021/11/30 01:04:09.679] Collecting attrs>=19.1.0 (from service_identity)
       [2021/11/30 01:04:09.679]   Using cached https://files.pythonhosted.org/packages/20/a9/ba6f1cd1a1517ff022b35acd6a7e4246371dfab08b8e42b829b6d07913cc/attrs-21.2.0-py2.py3-none-any.whl
       [2021/11/30 01:04:09.976] Collecting cffi>=1.12 (from cryptography>=3.3->pyopenssl)
       [2021/11/30 01:04:09.976]   Using cached https://files.pythonhosted.org/packages/0a/fe/f5090f4b636cef41680510fba13eee107420e6e016a8d30c386eb832a964/cffi-1.15.0-cp36-cp36m-win_amd64.whl
       [2021/11/30 01:04:10.028] Collecting pycparser (from cffi>=1.12->cryptography>=3.3->pyopenssl)
       [2021/11/30 01:04:10.028]   Using cached https://files.pythonhosted.org/packages/62/d5/5f610ebe421e85889f2e55e33b7f9a6795bd982198517d912eb1c76e1a53/pycparser-2.21-py2.py3-none-any.whl
       [2021/11/30 01:04:10.151] Installing collected packages: pycparser, cffi, cryptography, six, pyopenssl, urllib3, certifi, charset-normalizer, idna, requests, pyasn1, pyasn1-modules, attrs, service-identity
       [2021/11/30 01:04:11.593]   Running setup.py install for cryptography: started
       [2021/11/30 01:04:11.593]     Running setup.py install for cryptography: finished with status 'error'
       [2021/11/30 01:04:11.593]     Complete output from command C:\data\mci\c4d24bf371b7ccd06f6e4fae90d21496\src\pyopenssltest\Scripts\python.exe -u -c "import setuptools, tokenize;__file__='C:\\data\\mci\\c4d24bf371b7ccd06f6e4fae90d21496\\drivers-tools\\.evergreen\\orchestration\\db\\pip-install-pugfmtki\\cryptography\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\data\mci\c4d24bf371b7ccd06f6e4fae90d21496\drivers-tools\.evergreen\orchestration\db\pip-record-8qhtfp54\install-record.txt --single-version-externally-managed --compile --install-headers C:\data\mci\c4d24bf371b7ccd06f6e4fae90d21496\src\pyopenssltest\include\site\python3.6\cryptography:
       [2021/11/30 01:04:11.594]     running install
       [2021/11/30 01:04:11.594]     C:\data\mci\c4d24bf371b7ccd06f6e4fae90d21496\drivers-tools\.evergreen\orchestration\db\pip-build-env-a32v80w1\Lib\site-packages\setuptools\command\install.py:37: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
       [2021/11/30 01:04:11.594]       setuptools.SetuptoolsDeprecationWarning,
       [2021/11/30 01:04:11.594]     running build
       [2021/11/30 01:04:11.594]     running build_py
       [2021/11/30 01:04:11.594]     creating build
       [2021/11/30 01:04:11.594]     creating build\lib.win-amd64-3.6
       [2021/11/30 01:04:11.594]     creating build\lib.win-amd64-3.6\cryptography
      ...
       [2021/11/30 01:04:11.594]     copying src\cryptography\hazmat\bindings\_rust\x509.pyi -> build\lib.win-amd64-3.6\cryptography\hazmat\bindings\_rust
       [2021/11/30 01:04:11.594]     running build_ext
       [2021/11/30 01:04:11.594]     running build_rust
       [2021/11/30 01:04:11.594]         =============================DEBUG ASSISTANCE=============================
       [2021/11/30 01:04:11.594]         If you are seeing a compilation error please try the following steps to
       [2021/11/30 01:04:11.594]         successfully install cryptography:
       [2021/11/30 01:04:11.594]         1) Upgrade to the latest pip and try again. This will fix errors for most
       [2021/11/30 01:04:11.594]            users. See: https://pip.pypa.io/en/stable/installing/#upgrading-pip
       [2021/11/30 01:04:11.594]         2) Read https://cryptography.io/en/latest/installation/ for specific
       [2021/11/30 01:04:11.594]            instructions for your platform.
       [2021/11/30 01:04:11.594]         3) Check our frequently asked questions for more information:
       [2021/11/30 01:04:11.594]            https://cryptography.io/en/latest/faq/
       [2021/11/30 01:04:11.594]         4) Ensure you have a recent Rust toolchain installed:
       [2021/11/30 01:04:11.594]            https://cryptography.io/en/latest/installation/#rust
       [2021/11/30 01:04:11.594]         Python: 3.6.8
       [2021/11/30 01:04:11.594]         platform: Windows-10-10.0.17763-SP0
       [2021/11/30 01:04:11.594]         pip: 18.1
       [2021/11/30 01:04:11.594]         setuptools: 59.4.0
       [2021/11/30 01:04:11.594]         setuptools_rust: 1.0.0
       [2021/11/30 01:04:11.594]         =============================DEBUG ASSISTANCE=============================
       [2021/11/30 01:04:11.594]     error: can't find Rust compiler
       [2021/11/30 01:04:11.594]     If you are using an outdated pip version, it is possible a prebuilt wheel is available for this package but pip is not able to install from it. Installing from the wheel would avoid the need for a Rust compiler.
       [2021/11/30 01:04:11.594]     To update pip, run:
       [2021/11/30 01:04:11.594]         pip install --upgrade pip
       [2021/11/30 01:04:11.594]     and then retry package installation.
       [2021/11/30 01:04:11.594]     If you did intend to build this package from source, try installing a Rust compiler from your system package manager and ensure it is on the PATH during installation. Alternatively, rustup (available at https://rustup.rs) is the recommended way to download and update the Rust compiler toolchain.
       [2021/11/30 01:04:11.594]     This package requires Rust >=1.41.0.
       [2021/11/30 01:04:11.895] Command "C:\data\mci\c4d24bf371b7ccd06f6e4fae90d21496\src\pyopenssltest\Scripts\python.exe -u -c "import setuptools, tokenize;__file__='C:\\data\\mci\\c4d24bf371b7ccd06f6e4fae90d21496\\drivers-tools\\.evergreen\\orchestration\\db\\pip-install-pugfmtki\\cryptography\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\data\mci\c4d24bf371b7ccd06f6e4fae90d21496\drivers-tools\.evergreen\orchestration\db\pip-record-8qhtfp54\install-record.txt --single-version-externally-managed --compile --install-headers C:\data\mci\c4d24bf371b7ccd06f6e4fae90d21496\src\pyopenssltest\include\site\python3.6\cryptography" failed with error code 1 in C:\data\mci\c4d24bf371b7ccd06f6e4fae90d21496\drivers-tools\.evergreen\orchestration\db\pip-install-pugfmtki\cryptography\
       [2021/11/30 01:04:11.910] You are using pip version 18.1, however version 21.3.1 is available.
       [2021/11/30 01:04:11.910] You should consider upgrading via the 'python -m pip install --upgrade pip' command.
      ...
       [2021/11/30 01:04:12.187] Command failed: command encountered problem: error waiting on process '146b70b8-58c7-447a-b699-476f1318307e': exit status 1
      

      https://evergreen.mongodb.com/task/mongo_python_driver_tests_pyopenssl_windows__platform~windows_64_vsMulti_small_auth~auth_ssl~ssl_python_version_windows~3.6_pyopenssl~enabled_test_3.6_replica_set_e3d1d6f5b48101654a05493fd6eec7fe3fa014bd_21_11_29_18_32_30

            Assignee:
            shane.harvey@mongodb.com Shane Harvey
            Reporter:
            shane.harvey@mongodb.com Shane Harvey
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: