I found that to use pca it is neccessary to indicate at the begning the number of componenets to be kept such as in the next code :
# Initialize model = pca(n_com