AttributeError: module 'cryptography.hazmat.primitives.serialization' has no attribute 'pkcs12'
Closed this issue · 5 comments
I tried using the version 2.4.1_no_xgb as suggested in this thread [https://github.com//discussions/2741], but I still get the same issue when running the nvflare poc prepare command.
Any suggestions?
Here is how the pull is happening from the docker file
ARG NVF_VERSION=2.4.1_no_xgb
RUN git clone https://github.com/NVIDIA/NVFlare.git --branch ${NVF_BRANCH} --single-branch NVFlare
Error:
File "/usr/local/lib/python3.8/dist-packages/nvflare/lighter/spec.py", line 174, in provision b.build(project, ctx)
File "/usr/local/lib/python3.8/dist-packages/nvflare/lighter/impl/cert.py", line 137, in build
self._build_write_cert_pair(server, "server", ctx)
File "/usr/local/lib/python3.8/dist-packages/nvflare/lighter/impl/cert.py", line 119, in _build_write_cert_pair
pkcs12 = serialization.pkcs12.serialize_key_and_certificates(
AttributeError: module 'cryptography.hazmat.primitives.serialization' has no attribute 'pkcs12'
We faced the same thing. You can downgrade your cryptography
package to 42.0.8 and it'll work again.
@dvellanki thanks for raising this issue here, we will be updating our 2.4 to have this fix later for the public version.
If you use 2.4.1_no_xgb branch that should work correctly, do you mind sharing how you setup or how you run your experiment, it could be that in the middle of it, you install another version of NVFlare.
Another way as @parkeraddison suggested, you can downgrade your cryptography
package for now.
Thank you for the suggestions @YuanTingHsieh @parkeraddison . I will try downgrading the crypto version and see what happens. Meanwhile, here is my docker file for the xgb version that doesnt work for me.
ARG NVF_VERSION=2.4.1_no_xgb
ENV NVF_BRANCH=${NVF_VERSION}
ENV PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python
RUN pip install nvflare
WORKDIR /workspace/
RUN git clone https://github.com/NVIDIA/NVFlare.git --branch ${NVF_BRANCH} --single-branch NVFlare
WORKDIR /workspace/NVFlare
An update - downgrading the crypto version worked like a charm. Thank You!!