Why does pyspark have a problem with the same sentence on jupyter notebook, but on pycharm?

In the

Linux environment, I run

categoriMap = train.map(lambdax:x[3]).distinct().zipWithIndex().collectAsMap()
In such a sentence, there is no error in the normal operation of jupyter notebook, but not on pycharm. I would like to ask why the wrong content reported by
pycahrm is

.
Jul.07,2021
Menu