Maybe your pip install command is installing the latest transformers for a different version of python than the one you’re trying to run.
You should confirm that pip
is installing packages for python3.9
. Try pip --version
and check if the path it shows is python3.9.
You might need to instead run pip3 install -U transformers
or python3.9 -m pip install -U transformers