Error while converting the model: Module onnx is not installed!

I tried to use the Exporting Model feature using the example in this page

python convert_graph_to_onnx.py --framework pt --model bert-base-cased bert-base-cased.onnx

I got an error that I need to use ONNX opset version 14 so I Used this:

python convert_graph_to_onnx.py --framework pt --opset 14 --model bert-base-cased bert-base-cased.onnx

And I got this Error :

====== Converting model to ONNX ======
convert_graph_to_onnx.py:361: FutureWarning: The transformers.convert_graph_to_onnx package is deprecated and will be removed in version 5 of Transformers
warnings.warn(
ONNX opset version set to: 14
Loading pipeline (model: bert-base-cased, tokenizer: bert-base-cased)
Using framework PyTorch: 2.3.1+cpu
Found input input_ids with shape: {0: ‘batch’, 1: ‘sequence’}
Found input token_type_ids with shape: {0: ‘batch’, 1: ‘sequence’}
Found input attention_mask with shape: {0: ‘batch’, 1: ‘sequence’}
Found output output_0 with shape: {0: ‘batch’, 1: ‘sequence’}
Found output output_1 with shape: {0: ‘batch’}
Ensuring inputs are in correct order
position_ids is not present in the generated input list.
Generated inputs order: [‘input_ids’, ‘attention_mask’, ‘token_type_ids’]
Error while converting the model: Module onnx is not installed!
I have onnx==1.16.1 installed
Could somebody help me?