Cudnn_cnn_train64_8.dll existed but could not be found when using a library

It seems that it is because I used conda to install PyTorch and used pip to install the spacy library. When I used conda to install both of them it worked.