BUG: fix NameError raised when specifying dtype with string having "[pyarrow]" while PyArrow is not installed
I thinks this is more like a bug than enhancement, as quoted from the OP:

> This conforms to the description in [Installation Guide](https://pandas.pydata.org/docs/getting_started/install.html#optional-dependencies): If the optional dependency is not installed, pandas will raise an ImportError when the method requiring that dependency is called.

- [x] closes #57928 (Replace xxxx with the GitHub issue number)
- [x] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [x] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [ ] Added [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) to new arguments/methods/functions.
- [x] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.

Thanks @yuanx749 