DOC: Loading sphinxcontrib.spelling to sphinx only if it's available (#21396)
- [X] closes #21396
- [ ] tests added / passed
- [ ] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry

I think the optional dependencies go directly into the `.txt` files for pip and conda, and not into the yaml file. Please correct me if I'm wrong.

Seems like besides `sphinxcontrib-spelling`, a binary program `enchant` is required, and it's not available in conda for what I've seen. Not sure what's the right approach for it.
> I think the optional dependencies go directly into the .txt files for pip and conda, and not into the yaml file. Please correct me if I'm wrong.

Good call: I agree that it is an optional dependency.  You don't need it to install `pandas` for general use. As said on the issue, given the installation troubles, I would make this an optional one. Just FYI, I just followed the [instructions to create a development environment with Conda](https://pandas.pydata.org/pandas-docs/stable/contributing.html#creating-a-python-environment). On the `python -m pip install -e .` step, I got
```
sphinxcontrib-spelling 4.1.0 requires PyEnchant>=1.6.5, which is not installed.
```
Is that desired behavior or should the `environment.yml` file also include `PyEnchant` as a dependency?