That code is not always caused by an oxygen sensor. Low fuel pressure, an intake or exhaust leak are more common.
P0171 is System Too Lean (Bank 1), which means that the oxygen sensor detected an excessively lean air fuel mixture.
Trouble code P0171 means: System too lean (Bank 1)
p0171 fuel system lean bank 1 Causes include faulty oxygen sensor, weak fuel pump, plugged fuel filter, low fuel pressure, misfire, faulty map sensor, etc.
P0153 02 Sensor Circuit Slow Response (Bank 2 Sensor 1) P0171 System too Lean (Bank 1 P0304 Cylinder 4 Misfire Detected P0401 Exhaust Gas Recirculation Flow Insufficient Detected
Trouble code P0171 means: System Too Lean (Bank 1)
Trouble code P0171 means: System Too Lean (Bank 1)
Trouble code P0171 means: System Too Lean (Bank 1)
Trouble code P0171 means: System Too Lean (Bank 1)
Trouble code P0171 means: System Too Lean (Bank 1)
Trouble code P0171 means: Fuel System Lean (Bank 1)
Trouble code P0171 means: Fuel Trim System Lean (Bank 1)
Trouble code P0171 means: System Too Lean (Bank 1)