I’m in the process of trying to provision a nordic semiconductors device, specifically the Thingy 91, to use nRF Cloud services. In order to do the Just-In-Time provisioning I need to generate my device credentials which involved grabbing the private key and associated CSR for my device through the terminal as a CBOR object. I’m currently having difficulties trying to convert this object to a CSR using the modem_credentials_parser.py
script.
So where my issues begin:
When I initially tried to use this script I got back the message
<code>Traceback (most recent call last):
File "Z:modem_credentials_parser.py", line 11, in <module>
ModuleNotFoundError: No module named 'cbor2'
<code>Traceback (most recent call last):
File "Z:modem_credentials_parser.py", line 11, in <module>
from cbor2 import loads
ModuleNotFoundError: No module named 'cbor2'
</code>
Traceback (most recent call last):
File "Z:modem_credentials_parser.py", line 11, in <module>
from cbor2 import loads
ModuleNotFoundError: No module named 'cbor2'
I then tried to install cbor2 through pip install cbor2
which is where I get this warning a few times before an error
<code> WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate in certificate chain (_ssl.c:1006)'))': /packages/97/1f/d019205dd6435e4236d9f3f35db43a67be0f4d7cc96c77cf3f7ad76ad2d8/cbor2-5.6.4-py3-none-any.whl.metadata
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate in certificate chain (_ssl.c:1006)'))': /packages/97/1f/d019205dd6435e4236d9f3f35db43a67be0f4d7cc96c77cf3f7ad76ad2d8/cbor2-5.6.4-py3-none-any.whl.metadata
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate in certificate chain (_ssl.c:1006)'))': /packages/97/1f/d019205dd6435e4236d9f3f35db43a67be0f4d7cc96c77cf3f7ad76ad2d8/cbor2-5.6.4-py3-none-any.whl.metadata
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate in certificate chain (_ssl.c:1006)'))': /packages/97/1f/d019205dd6435e4236d9f3f35db43a67be0f4d7cc96c77cf3f7ad76ad2d8/cbor2-5.6.4-py3-none-any.whl.metadata
ERROR: Operation cancelled by user
<code> WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate in certificate chain (_ssl.c:1006)'))': /packages/97/1f/d019205dd6435e4236d9f3f35db43a67be0f4d7cc96c77cf3f7ad76ad2d8/cbor2-5.6.4-py3-none-any.whl.metadata
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate in certificate chain (_ssl.c:1006)'))': /packages/97/1f/d019205dd6435e4236d9f3f35db43a67be0f4d7cc96c77cf3f7ad76ad2d8/cbor2-5.6.4-py3-none-any.whl.metadata
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate in certificate chain (_ssl.c:1006)'))': /packages/97/1f/d019205dd6435e4236d9f3f35db43a67be0f4d7cc96c77cf3f7ad76ad2d8/cbor2-5.6.4-py3-none-any.whl.metadata
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate in certificate chain (_ssl.c:1006)'))': /packages/97/1f/d019205dd6435e4236d9f3f35db43a67be0f4d7cc96c77cf3f7ad76ad2d8/cbor2-5.6.4-py3-none-any.whl.metadata
ERROR: Operation cancelled by user
</code>
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate in certificate chain (_ssl.c:1006)'))': /packages/97/1f/d019205dd6435e4236d9f3f35db43a67be0f4d7cc96c77cf3f7ad76ad2d8/cbor2-5.6.4-py3-none-any.whl.metadata
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate in certificate chain (_ssl.c:1006)'))': /packages/97/1f/d019205dd6435e4236d9f3f35db43a67be0f4d7cc96c77cf3f7ad76ad2d8/cbor2-5.6.4-py3-none-any.whl.metadata
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate in certificate chain (_ssl.c:1006)'))': /packages/97/1f/d019205dd6435e4236d9f3f35db43a67be0f4d7cc96c77cf3f7ad76ad2d8/cbor2-5.6.4-py3-none-any.whl.metadata
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate in certificate chain (_ssl.c:1006)'))': /packages/97/1f/d019205dd6435e4236d9f3f35db43a67be0f4d7cc96c77cf3f7ad76ad2d8/cbor2-5.6.4-py3-none-any.whl.metadata
ERROR: Operation cancelled by user
underneath I get the notice to update to a new release of pip so I do have pip downloaded and it’s PATH is added to my system environmental variables
<code>[notice] A new release of pip is available: 24.0 -> 24.1.2
[notice] To update, run: python.exe -m pip install --upgrade pip
<code>[notice] A new release of pip is available: 24.0 -> 24.1.2
[notice] To update, run: python.exe -m pip install --upgrade pip
</code>
[notice] A new release of pip is available: 24.0 -> 24.1.2
[notice] To update, run: python.exe -m pip install --upgrade pip
If I try to update to the new release I get the same warning and finally the error
<code> WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate in certificate chain (_ssl.c:1006)'))': /packages/e7/54/0c1c068542cee73d8863336e974fc881e608d0170f3af15d0c0f28644531/pip-24.1.2-py3-none-any.whl.metadata
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate in certificate chain (_ssl.c:1006)'))': /packages/e7/54/0c1c068542cee73d8863336e974fc881e608d0170f3af15d0c0f28644531/pip-24.1.2-py3-none-any.whl.metadata
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate in certificate chain (_ssl.c:1006)'))': /packages/e7/54/0c1c068542cee73d8863336e974fc881e608d0170f3af15d0c0f28644531/pip-24.1.2-py3-none-any.whl.metadata
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate in certificate chain (_ssl.c:1006)'))': /packages/e7/54/0c1c068542cee73d8863336e974fc881e608d0170f3af15d0c0f28644531/pip-24.1.2-py3-none-any.whl.metadata
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate in certificate chain (_ssl.c:1006)'))': /packages/e7/54/0c1c068542cee73d8863336e974fc881e608d0170f3af15d0c0f28644531/pip-24.1.2-py3-none-any.whl.metadata
ERROR: Could not install packages due to an OSError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Max retries exceeded with url: /packages/e7/54/0c1c068542cee73d8863336e974fc881e608d0170f3af15d0c0f28644531/pip-24.1.2-py3-none-any.whl.metadata (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate in certificate chain (_ssl.c:1006)')))
<code> WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate in certificate chain (_ssl.c:1006)'))': /packages/e7/54/0c1c068542cee73d8863336e974fc881e608d0170f3af15d0c0f28644531/pip-24.1.2-py3-none-any.whl.metadata
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate in certificate chain (_ssl.c:1006)'))': /packages/e7/54/0c1c068542cee73d8863336e974fc881e608d0170f3af15d0c0f28644531/pip-24.1.2-py3-none-any.whl.metadata
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate in certificate chain (_ssl.c:1006)'))': /packages/e7/54/0c1c068542cee73d8863336e974fc881e608d0170f3af15d0c0f28644531/pip-24.1.2-py3-none-any.whl.metadata
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate in certificate chain (_ssl.c:1006)'))': /packages/e7/54/0c1c068542cee73d8863336e974fc881e608d0170f3af15d0c0f28644531/pip-24.1.2-py3-none-any.whl.metadata
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate in certificate chain (_ssl.c:1006)'))': /packages/e7/54/0c1c068542cee73d8863336e974fc881e608d0170f3af15d0c0f28644531/pip-24.1.2-py3-none-any.whl.metadata
ERROR: Could not install packages due to an OSError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Max retries exceeded with url: /packages/e7/54/0c1c068542cee73d8863336e974fc881e608d0170f3af15d0c0f28644531/pip-24.1.2-py3-none-any.whl.metadata (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate in certificate chain (_ssl.c:1006)')))
</code>
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate in certificate chain (_ssl.c:1006)'))': /packages/e7/54/0c1c068542cee73d8863336e974fc881e608d0170f3af15d0c0f28644531/pip-24.1.2-py3-none-any.whl.metadata
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate in certificate chain (_ssl.c:1006)'))': /packages/e7/54/0c1c068542cee73d8863336e974fc881e608d0170f3af15d0c0f28644531/pip-24.1.2-py3-none-any.whl.metadata
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate in certificate chain (_ssl.c:1006)'))': /packages/e7/54/0c1c068542cee73d8863336e974fc881e608d0170f3af15d0c0f28644531/pip-24.1.2-py3-none-any.whl.metadata
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate in certificate chain (_ssl.c:1006)'))': /packages/e7/54/0c1c068542cee73d8863336e974fc881e608d0170f3af15d0c0f28644531/pip-24.1.2-py3-none-any.whl.metadata
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate in certificate chain (_ssl.c:1006)'))': /packages/e7/54/0c1c068542cee73d8863336e974fc881e608d0170f3af15d0c0f28644531/pip-24.1.2-py3-none-any.whl.metadata
ERROR: Could not install packages due to an OSError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Max retries exceeded with url: /packages/e7/54/0c1c068542cee73d8863336e974fc881e608d0170f3af15d0c0f28644531/pip-24.1.2-py3-none-any.whl.metadata (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate in certificate chain (_ssl.c:1006)')))
So at this point I’m pretty stuck on where to go because I initially based on my errors and other people’s posts thought I had an issue downloading pip but that seems to be fine on my machine after following Method 1 of this tutorial https://phoenixnap.com/kb/install-pip-windows and things seemed to be running smoothly.
I’m not sure what else I need to fix. Any help would be greatly appreciated!
EDIT:
After being able to configure pip to the CA certificate associated with my place of work I was able to create a virtual environment and update pip to the latest version without throwing an SSL error. I’ve added this new environment to my PATH and then tried to install my requirements.txt file in order to use the python script associated with my initial task ;-;
When I enter pip install -r requirements.txt
I get the following error:
<code> Looking in indexes: https://artifactory.arl.psu.edu/artifactory/api/pypi/pypi/simple Collecting auto_mix_prep>=0.2.0 (from -r requirements.txt (line 1)) Using cached https://artifactory.arl.psu.edu/artifactory/api/pypi/pypi/packages/packages/53/8d/94fade74736b4e94dd8dd45c2a2d12fc4863f3ffe8decc26abc7353be21d/auto-mix-prep-0.2.0.tar.gz (2.9 kB) Installing build dependencies ... done Getting requirements to build wheel ... done Preparing metadata (pyproject.toml) ... done Collecting cbor2>=5.4.2.post1 (from -r requirements.txt (line 2)) Using cached https://artifactory.arl.psu.edu/artifactory/api/pypi/pypi/packages/packages/97/1f/d019205dd6435e4236d9f3f35db43a67be0f4d7cc96c77cf3f7ad76ad2d8/cbor2-5.6.4-py3-none-any.whl (23 kB) Collecting colorama>=0.4.4 (from -r requirements.txt (line 3)) Using cached https://artifactory.arl.psu.edu/artifactory/api/pypi/pypi/packages/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl (25 kB) Collecting cryptography>=36.0.1 (from -r requirements.txt (line 4)) Using cached https://artifactory.arl.psu.edu/artifactory/api/pypi/pypi/packages/packages/93/a7/1498799a2ea06148463a9a2c10ab2f6a921a74fb19e231b27dc412a748e2/cryptography-42.0.8.tar.gz (671 kB) Installing build dependencies ... error error: subprocess-exited-with-error
× pip subprocess to install build dependencies did not run successfully. │ exit code: 1 ╰─> [86 lines of output]
Looking in indexes: https://artifactory.arl.psu.edu/artifactory/api/pypi/pypi/simple
Collecting setuptools>=61.0.0
Using cached https://artifactory.arl.psu.edu/artifactory/api/pypi/pypi/packages/packages/32/10/e72bb221cdd2f11e649cf38bd7ba8ea6d527c77f330366e10ae9bb798730/setuptools-71.0.3-py3-none-any.whl (2.3 MB)
Using cached https://artifactory.arl.psu.edu/artifactory/api/pypi/pypi/packages/packages/7d/cd/d7460c9a869b16c3dd4e1e403cce337df165368c71d6af229a74699622ce/wheel-0.43.0-py3-none-any.whl (65 kB)
Using cached https://artifactory.arl.psu.edu/artifactory/api/pypi/pypi/packages/packages/68/ce/95b0bae7968c65473e1298efb042e10cafc7bafc14d9e4f154008241c91d/cffi-1.16.0.tar.gz (512 kB)
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'done'
Preparing metadata (pyproject.toml): started
Preparing metadata (pyproject.toml): finished with status 'done'
Collecting setuptools-rust>=1.7.0
Using cached https://artifactory.arl.psu.edu/artifactory/api/pypi/pypi/packages/packages/f7/7f/8b1c33598b03ad612b8ced223f9ca54076b789fabf5a66ce37cc096d9cf7/setuptools_rust-1.9.0-py3-none-any.whl (26 kB)
Collecting pycparser (from cffi>=1.12)
Using cached https://artifactory.arl.psu.edu/artifactory/api/pypi/pypi/packages/packages/13/a3/a812df4e2dd5696d1f351d58b8fe16a405b234ad2886a0dab9183fb78109/pycparser-2.22-py3-none-any.whl (117 kB)
Collecting semantic-version<3,>=2.8.2 (from setuptools-rust>=1.7.0)
Using cached https://artifactory.arl.psu.edu/artifactory/api/pypi/pypi/packages/packages/6a/23/8146aad7d88f4fcb3a6218f41a60f6c2d4e3a72de72da1825dc7c8f7877c/semantic_version-2.10.0-py2.py3-none-any.whl (15 kB)
Building wheels for collected packages: cffi
Building wheel for cffi (pyproject.toml): started
Building wheel for cffi (pyproject.toml): finished with status 'error'
error: subprocess-exited-with-error
Building wheel for cffi (pyproject.toml) did not run successfully.
_configtest.c:2:2: error: #error "not MSVC"
Note: will not use '__thread' in the C code
***** The above error message can be safely ignored.
creating buildlib.mingw_x86_64-cpython-311
creating buildlib.mingw_x86_64-cpython-311cffi
copying srccffiapi.py -> buildlib.mingw_x86_64-cpython-311cffi
copying srccffibackend_ctypes.py -> buildlib.mingw_x86_64-cpython-311cffi
copying srccfficffi_opcode.py -> buildlib.mingw_x86_64-cpython-311cffi
copying srccfficommontypes.py -> buildlib.mingw_x86_64-cpython-311cffi
copying srccfficparser.py -> buildlib.mingw_x86_64-cpython-311cffi
copying srccffierror.py -> buildlib.mingw_x86_64-cpython-311cffi
copying srccffiffiplatform.py -> buildlib.mingw_x86_64-cpython-311cffi
copying srccffilock.py -> buildlib.mingw_x86_64-cpython-311cffi
copying srccffimodel.py -> buildlib.mingw_x86_64-cpython-311cffi
copying srccffipkgconfig.py -> buildlib.mingw_x86_64-cpython-311cffi
copying srccffirecompiler.py -> buildlib.mingw_x86_64-cpython-311cffi
copying srccffisetuptools_ext.py -> buildlib.mingw_x86_64-cpython-311cffi
copying srccffivengine_cpy.py -> buildlib.mingw_x86_64-cpython-311cffi
copying srccffivengine_gen.py -> buildlib.mingw_x86_64-cpython-311cffi
copying srccffiverifier.py -> buildlib.mingw_x86_64-cpython-311cffi
copying srccffi_imp_emulation.py -> buildlib.mingw_x86_64-cpython-311cffi
copying srccffi_shimmed_dist_utils.py -> buildlib.mingw_x86_64-cpython-311cffi
copying srccffi__init__.py -> buildlib.mingw_x86_64-cpython-311cffi
copying srccffi_cffi_include.h -> buildlib.mingw_x86_64-cpython-311cffi
copying srccffiparse_c_type.h -> buildlib.mingw_x86_64-cpython-311cffi
copying srccffi_embedding.h -> buildlib.mingw_x86_64-cpython-311cffi
copying srccffi_cffi_errors.h -> buildlib.mingw_x86_64-cpython-311cffi
building '_cffi_backend' extension
creating buildtemp.mingw_x86_64-cpython-311
creating buildtemp.mingw_x86_64-cpython-311src
creating buildtemp.mingw_x86_64-cpython-311srcc
gcc -DNDEBUG -g -fwrapv -O3 -Wall -march=nocona -msahf -mtune=generic -O2 -pipe -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-strong -O3 -march=nocona -msahf -mtune=generic -O2 -pipe -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-strong -O3 -DFFI_BUILDING=1 -IC:/msys64/mingw64/bin/../include -IC:msys64mingw64/include/python3.11 -c src/c/_cffi_backend.c -o buildtemp.mingw_x86_64-cpython-311srcc_cffi_backend.o
src/c/_cffi_backend.c: In function 'b_do_dlopen':
src/c/_cffi_backend.c:4521:40: error: passing argument 1 of 'PyUnicode_AsWideChar' from incompatible pointer type [-Wincompatible-pointer-types]
4521 | sz1 = PyUnicode_AsWideChar((PyUnicodeObject *)filename_unicode,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from C:msys64mingw64/include/python3.11/Python.h:51,
from src/c/_cffi_backend.c:2:
C:msys64mingw64/include/python3.11/unicodeobject.h:299:15: note: expected 'PyObject *' {aka 'struct _object *'} but argument is of type 'PyUnicodeObject *'
299 | PyObject *unicode, /* Unicode object */
error: command 'C:\msys64\mingw64\bin\gcc.EXE' failed with exit code 1
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for cffi
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (cffi)
note: This error originates from a subprocess, and is likely not a problem with pip. error: subprocess-exited-with-error
× pip subprocess to install build dependencies did not run successfully. │ exit code: 1 ╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
<code> Looking in indexes: https://artifactory.arl.psu.edu/artifactory/api/pypi/pypi/simple Collecting auto_mix_prep>=0.2.0 (from -r requirements.txt (line 1)) Using cached https://artifactory.arl.psu.edu/artifactory/api/pypi/pypi/packages/packages/53/8d/94fade74736b4e94dd8dd45c2a2d12fc4863f3ffe8decc26abc7353be21d/auto-mix-prep-0.2.0.tar.gz (2.9 kB) Installing build dependencies ... done Getting requirements to build wheel ... done Preparing metadata (pyproject.toml) ... done Collecting cbor2>=5.4.2.post1 (from -r requirements.txt (line 2)) Using cached https://artifactory.arl.psu.edu/artifactory/api/pypi/pypi/packages/packages/97/1f/d019205dd6435e4236d9f3f35db43a67be0f4d7cc96c77cf3f7ad76ad2d8/cbor2-5.6.4-py3-none-any.whl (23 kB) Collecting colorama>=0.4.4 (from -r requirements.txt (line 3)) Using cached https://artifactory.arl.psu.edu/artifactory/api/pypi/pypi/packages/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl (25 kB) Collecting cryptography>=36.0.1 (from -r requirements.txt (line 4)) Using cached https://artifactory.arl.psu.edu/artifactory/api/pypi/pypi/packages/packages/93/a7/1498799a2ea06148463a9a2c10ab2f6a921a74fb19e231b27dc412a748e2/cryptography-42.0.8.tar.gz (671 kB) Installing build dependencies ... error error: subprocess-exited-with-error
× pip subprocess to install build dependencies did not run successfully. │ exit code: 1 ╰─> [86 lines of output]
Looking in indexes: https://artifactory.arl.psu.edu/artifactory/api/pypi/pypi/simple
Collecting setuptools>=61.0.0
Using cached https://artifactory.arl.psu.edu/artifactory/api/pypi/pypi/packages/packages/32/10/e72bb221cdd2f11e649cf38bd7ba8ea6d527c77f330366e10ae9bb798730/setuptools-71.0.3-py3-none-any.whl (2.3 MB)
Collecting wheel
Using cached https://artifactory.arl.psu.edu/artifactory/api/pypi/pypi/packages/packages/7d/cd/d7460c9a869b16c3dd4e1e403cce337df165368c71d6af229a74699622ce/wheel-0.43.0-py3-none-any.whl (65 kB)
Collecting cffi>=1.12
Using cached https://artifactory.arl.psu.edu/artifactory/api/pypi/pypi/packages/packages/68/ce/95b0bae7968c65473e1298efb042e10cafc7bafc14d9e4f154008241c91d/cffi-1.16.0.tar.gz (512 kB)
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'done'
Preparing metadata (pyproject.toml): started
Preparing metadata (pyproject.toml): finished with status 'done'
Collecting setuptools-rust>=1.7.0
Using cached https://artifactory.arl.psu.edu/artifactory/api/pypi/pypi/packages/packages/f7/7f/8b1c33598b03ad612b8ced223f9ca54076b789fabf5a66ce37cc096d9cf7/setuptools_rust-1.9.0-py3-none-any.whl (26 kB)
Collecting pycparser (from cffi>=1.12)
Using cached https://artifactory.arl.psu.edu/artifactory/api/pypi/pypi/packages/packages/13/a3/a812df4e2dd5696d1f351d58b8fe16a405b234ad2886a0dab9183fb78109/pycparser-2.22-py3-none-any.whl (117 kB)
Collecting semantic-version<3,>=2.8.2 (from setuptools-rust>=1.7.0)
Using cached https://artifactory.arl.psu.edu/artifactory/api/pypi/pypi/packages/packages/6a/23/8146aad7d88f4fcb3a6218f41a60f6c2d4e3a72de72da1825dc7c8f7877c/semantic_version-2.10.0-py2.py3-none-any.whl (15 kB)
Building wheels for collected packages: cffi
Building wheel for cffi (pyproject.toml): started
Building wheel for cffi (pyproject.toml): finished with status 'error'
error: subprocess-exited-with-error
Building wheel for cffi (pyproject.toml) did not run successfully.
exit code: 1
[52 lines of output]
_configtest.c:2:2: error: #error "not MSVC"
2 | #error "not MSVC"
| ^~~~~
Note: will not use '__thread' in the C code
***** The above error message can be safely ignored.
running bdist_wheel
running build
running build_py
creating build
creating buildlib.mingw_x86_64-cpython-311
creating buildlib.mingw_x86_64-cpython-311cffi
copying srccffiapi.py -> buildlib.mingw_x86_64-cpython-311cffi
copying srccffibackend_ctypes.py -> buildlib.mingw_x86_64-cpython-311cffi
copying srccfficffi_opcode.py -> buildlib.mingw_x86_64-cpython-311cffi
copying srccfficommontypes.py -> buildlib.mingw_x86_64-cpython-311cffi
copying srccfficparser.py -> buildlib.mingw_x86_64-cpython-311cffi
copying srccffierror.py -> buildlib.mingw_x86_64-cpython-311cffi
copying srccffiffiplatform.py -> buildlib.mingw_x86_64-cpython-311cffi
copying srccffilock.py -> buildlib.mingw_x86_64-cpython-311cffi
copying srccffimodel.py -> buildlib.mingw_x86_64-cpython-311cffi
copying srccffipkgconfig.py -> buildlib.mingw_x86_64-cpython-311cffi
copying srccffirecompiler.py -> buildlib.mingw_x86_64-cpython-311cffi
copying srccffisetuptools_ext.py -> buildlib.mingw_x86_64-cpython-311cffi
copying srccffivengine_cpy.py -> buildlib.mingw_x86_64-cpython-311cffi
copying srccffivengine_gen.py -> buildlib.mingw_x86_64-cpython-311cffi
copying srccffiverifier.py -> buildlib.mingw_x86_64-cpython-311cffi
copying srccffi_imp_emulation.py -> buildlib.mingw_x86_64-cpython-311cffi
copying srccffi_shimmed_dist_utils.py -> buildlib.mingw_x86_64-cpython-311cffi
copying srccffi__init__.py -> buildlib.mingw_x86_64-cpython-311cffi
copying srccffi_cffi_include.h -> buildlib.mingw_x86_64-cpython-311cffi
copying srccffiparse_c_type.h -> buildlib.mingw_x86_64-cpython-311cffi
copying srccffi_embedding.h -> buildlib.mingw_x86_64-cpython-311cffi
copying srccffi_cffi_errors.h -> buildlib.mingw_x86_64-cpython-311cffi
running build_ext
building '_cffi_backend' extension
creating buildtemp.mingw_x86_64-cpython-311
creating buildtemp.mingw_x86_64-cpython-311src
creating buildtemp.mingw_x86_64-cpython-311srcc
gcc -DNDEBUG -g -fwrapv -O3 -Wall -march=nocona -msahf -mtune=generic -O2 -pipe -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-strong -O3 -march=nocona -msahf -mtune=generic -O2 -pipe -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-strong -O3 -DFFI_BUILDING=1 -IC:/msys64/mingw64/bin/../include -IC:msys64mingw64/include/python3.11 -c src/c/_cffi_backend.c -o buildtemp.mingw_x86_64-cpython-311srcc_cffi_backend.o
src/c/_cffi_backend.c: In function 'b_do_dlopen':
src/c/_cffi_backend.c:4521:40: error: passing argument 1 of 'PyUnicode_AsWideChar' from incompatible pointer type [-Wincompatible-pointer-types]
4521 | sz1 = PyUnicode_AsWideChar((PyUnicodeObject *)filename_unicode,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| PyUnicodeObject *
In file included from C:msys64mingw64/include/python3.11/Python.h:51,
from src/c/_cffi_backend.c:2:
C:msys64mingw64/include/python3.11/unicodeobject.h:299:15: note: expected 'PyObject *' {aka 'struct _object *'} but argument is of type 'PyUnicodeObject *'
299 | PyObject *unicode, /* Unicode object */
| ~~~~~~~~~~^~~~~~~
error: command 'C:\msys64\mingw64\bin\gcc.EXE' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for cffi
Failed to build cffi
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (cffi)
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip. error: subprocess-exited-with-error
× pip subprocess to install build dependencies did not run successfully. │ exit code: 1 ╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
</code>
Looking in indexes: https://artifactory.arl.psu.edu/artifactory/api/pypi/pypi/simple Collecting auto_mix_prep>=0.2.0 (from -r requirements.txt (line 1)) Using cached https://artifactory.arl.psu.edu/artifactory/api/pypi/pypi/packages/packages/53/8d/94fade74736b4e94dd8dd45c2a2d12fc4863f3ffe8decc26abc7353be21d/auto-mix-prep-0.2.0.tar.gz (2.9 kB) Installing build dependencies ... done Getting requirements to build wheel ... done Preparing metadata (pyproject.toml) ... done Collecting cbor2>=5.4.2.post1 (from -r requirements.txt (line 2)) Using cached https://artifactory.arl.psu.edu/artifactory/api/pypi/pypi/packages/packages/97/1f/d019205dd6435e4236d9f3f35db43a67be0f4d7cc96c77cf3f7ad76ad2d8/cbor2-5.6.4-py3-none-any.whl (23 kB) Collecting colorama>=0.4.4 (from -r requirements.txt (line 3)) Using cached https://artifactory.arl.psu.edu/artifactory/api/pypi/pypi/packages/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl (25 kB) Collecting cryptography>=36.0.1 (from -r requirements.txt (line 4)) Using cached https://artifactory.arl.psu.edu/artifactory/api/pypi/pypi/packages/packages/93/a7/1498799a2ea06148463a9a2c10ab2f6a921a74fb19e231b27dc412a748e2/cryptography-42.0.8.tar.gz (671 kB) Installing build dependencies ... error error: subprocess-exited-with-error
× pip subprocess to install build dependencies did not run successfully. │ exit code: 1 ╰─> [86 lines of output]
Looking in indexes: https://artifactory.arl.psu.edu/artifactory/api/pypi/pypi/simple
Collecting setuptools>=61.0.0
Using cached https://artifactory.arl.psu.edu/artifactory/api/pypi/pypi/packages/packages/32/10/e72bb221cdd2f11e649cf38bd7ba8ea6d527c77f330366e10ae9bb798730/setuptools-71.0.3-py3-none-any.whl (2.3 MB)
Collecting wheel
Using cached https://artifactory.arl.psu.edu/artifactory/api/pypi/pypi/packages/packages/7d/cd/d7460c9a869b16c3dd4e1e403cce337df165368c71d6af229a74699622ce/wheel-0.43.0-py3-none-any.whl (65 kB)
Collecting cffi>=1.12
Using cached https://artifactory.arl.psu.edu/artifactory/api/pypi/pypi/packages/packages/68/ce/95b0bae7968c65473e1298efb042e10cafc7bafc14d9e4f154008241c91d/cffi-1.16.0.tar.gz (512 kB)
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'done'
Preparing metadata (pyproject.toml): started
Preparing metadata (pyproject.toml): finished with status 'done'
Collecting setuptools-rust>=1.7.0
Using cached https://artifactory.arl.psu.edu/artifactory/api/pypi/pypi/packages/packages/f7/7f/8b1c33598b03ad612b8ced223f9ca54076b789fabf5a66ce37cc096d9cf7/setuptools_rust-1.9.0-py3-none-any.whl (26 kB)
Collecting pycparser (from cffi>=1.12)
Using cached https://artifactory.arl.psu.edu/artifactory/api/pypi/pypi/packages/packages/13/a3/a812df4e2dd5696d1f351d58b8fe16a405b234ad2886a0dab9183fb78109/pycparser-2.22-py3-none-any.whl (117 kB)
Collecting semantic-version<3,>=2.8.2 (from setuptools-rust>=1.7.0)
Using cached https://artifactory.arl.psu.edu/artifactory/api/pypi/pypi/packages/packages/6a/23/8146aad7d88f4fcb3a6218f41a60f6c2d4e3a72de72da1825dc7c8f7877c/semantic_version-2.10.0-py2.py3-none-any.whl (15 kB)
Building wheels for collected packages: cffi
Building wheel for cffi (pyproject.toml): started
Building wheel for cffi (pyproject.toml): finished with status 'error'
error: subprocess-exited-with-error
Building wheel for cffi (pyproject.toml) did not run successfully.
exit code: 1
[52 lines of output]
_configtest.c:2:2: error: #error "not MSVC"
2 | #error "not MSVC"
| ^~~~~
Note: will not use '__thread' in the C code
***** The above error message can be safely ignored.
running bdist_wheel
running build
running build_py
creating build
creating buildlib.mingw_x86_64-cpython-311
creating buildlib.mingw_x86_64-cpython-311cffi
copying srccffiapi.py -> buildlib.mingw_x86_64-cpython-311cffi
copying srccffibackend_ctypes.py -> buildlib.mingw_x86_64-cpython-311cffi
copying srccfficffi_opcode.py -> buildlib.mingw_x86_64-cpython-311cffi
copying srccfficommontypes.py -> buildlib.mingw_x86_64-cpython-311cffi
copying srccfficparser.py -> buildlib.mingw_x86_64-cpython-311cffi
copying srccffierror.py -> buildlib.mingw_x86_64-cpython-311cffi
copying srccffiffiplatform.py -> buildlib.mingw_x86_64-cpython-311cffi
copying srccffilock.py -> buildlib.mingw_x86_64-cpython-311cffi
copying srccffimodel.py -> buildlib.mingw_x86_64-cpython-311cffi
copying srccffipkgconfig.py -> buildlib.mingw_x86_64-cpython-311cffi
copying srccffirecompiler.py -> buildlib.mingw_x86_64-cpython-311cffi
copying srccffisetuptools_ext.py -> buildlib.mingw_x86_64-cpython-311cffi
copying srccffivengine_cpy.py -> buildlib.mingw_x86_64-cpython-311cffi
copying srccffivengine_gen.py -> buildlib.mingw_x86_64-cpython-311cffi
copying srccffiverifier.py -> buildlib.mingw_x86_64-cpython-311cffi
copying srccffi_imp_emulation.py -> buildlib.mingw_x86_64-cpython-311cffi
copying srccffi_shimmed_dist_utils.py -> buildlib.mingw_x86_64-cpython-311cffi
copying srccffi__init__.py -> buildlib.mingw_x86_64-cpython-311cffi
copying srccffi_cffi_include.h -> buildlib.mingw_x86_64-cpython-311cffi
copying srccffiparse_c_type.h -> buildlib.mingw_x86_64-cpython-311cffi
copying srccffi_embedding.h -> buildlib.mingw_x86_64-cpython-311cffi
copying srccffi_cffi_errors.h -> buildlib.mingw_x86_64-cpython-311cffi
running build_ext
building '_cffi_backend' extension
creating buildtemp.mingw_x86_64-cpython-311
creating buildtemp.mingw_x86_64-cpython-311src
creating buildtemp.mingw_x86_64-cpython-311srcc
gcc -DNDEBUG -g -fwrapv -O3 -Wall -march=nocona -msahf -mtune=generic -O2 -pipe -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-strong -O3 -march=nocona -msahf -mtune=generic -O2 -pipe -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-strong -O3 -DFFI_BUILDING=1 -IC:/msys64/mingw64/bin/../include -IC:msys64mingw64/include/python3.11 -c src/c/_cffi_backend.c -o buildtemp.mingw_x86_64-cpython-311srcc_cffi_backend.o
src/c/_cffi_backend.c: In function 'b_do_dlopen':
src/c/_cffi_backend.c:4521:40: error: passing argument 1 of 'PyUnicode_AsWideChar' from incompatible pointer type [-Wincompatible-pointer-types]
4521 | sz1 = PyUnicode_AsWideChar((PyUnicodeObject *)filename_unicode,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| PyUnicodeObject *
In file included from C:msys64mingw64/include/python3.11/Python.h:51,
from src/c/_cffi_backend.c:2:
C:msys64mingw64/include/python3.11/unicodeobject.h:299:15: note: expected 'PyObject *' {aka 'struct _object *'} but argument is of type 'PyUnicodeObject *'
299 | PyObject *unicode, /* Unicode object */
| ~~~~~~~~~~^~~~~~~
error: command 'C:\msys64\mingw64\bin\gcc.EXE' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for cffi
Failed to build cffi
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (cffi)
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip. error: subprocess-exited-with-error
× pip subprocess to install build dependencies did not run successfully. │ exit code: 1 ╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
From this I’m pretty sure the actual error I’m facing is
<code>`ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (cffi)`
<code>`ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (cffi)`
</code>
`ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (cffi)`
I’ve gone through some other Stack Overflow posts and either it’s based around linux/ubuntu systems and I’m working with Windows 10 cmd prompt.
I thought I could use the solution from Failed to install Python Cryptography package with PIP and setup.py
where I would install cryptography however, I get thrown the same error as I did when installing my requirements.txt file.
Would love to hear some other suggestions on how to proceed as I am very much new to all of this and learning as I go. Thanks!!