Python 8.11 to 9 migration#

You can do nothing and everything should still work when migrating to VW 9. But if you want to move to the new way to avoid deprecation warnings and future breaks here’s a rundown.


Modules are now direcly accessible from the root module. In the past from vowpalwabbit import ... was needed, but now import vowpalwabbit and accessing with . will work.


The old pyvw types are now available under the root module.

Instead of:

from vowpalwabbit import pyvw


import vowpalwabbit

And use the corresponding types exposed by vowpalwabbit instead of vowpalwabbit.pyvw.


vowpalwabbit.pyvw.SearchTask is only available under vowpalwabbit.pyvw due to its advanced nature and less usage.


Replace any reference to the old module name DFtoVW with vowpalwabbit.dftovw.


Replace any reference to the old module name sklearn_vw with vowpalwabbit.sklearn.

Class names#


Instead of calling the free function vowpalwabbit.pyvw.get_prediction() call vowpalwabbit.Example.get_prediction() on an vowpalwabbit.Example instance.

Label types and prediction types#

Getting a label from an Example#


The first argument of vowpalwabbit.ExampleNamespace.push_features() was removed as it was not needed and unused. Using two arguments is deprecated, to fix the callsites remove the first argument.