Aiming to solve the problem that photovoltaic power generation is always accompanied by uncertainty and the short-term prediction accuracy of photovoltaic power (PV) is not high, this paper proposes a method for short-term photovoltaic power forecasting (PPF) and uncertainty analysis using the fuzzy-c-means (FCM), whale optimization algorithm (WOA), bi-directional long short-term memory (BILSTM), and no-parametric kernel density estimation (NPKDE). First, the principal component analysis (PCA) is used to reduce the dimensionality of the daily feature vector, and then the FCM is used to divide the weather into four categories: sunny, cloudy, rainy, and extreme weather. Second, the WOA algorithm is used to train the hyperparameters of BILSTM, and finally, the optimized hyperparameters were used to construct a WOA-BILSTM prediction model to train the four types of weather samples after FCM clustering. The NPKDE method was used to calculate the probability density distribution of PV prediction errors and confidence intervals for PPF. The RMSEs of the FCM-WOA-BILSTM model are 2.46%, 4.89%, and 1.14% for sunny, cloudy, and rainy weather types, respectively. The simulation results of the calculation example show that compared with the BP, LSTM, GRU, PSO-BILSTM, and FCM-PSO-BP models, the proposed FCM-WOA-BILSTM model has higher prediction accuracy under various weather types, which verifies the effectiveness of the method. Moreover, the NPKDE method can accurately describe the probability density distribution of forecast errors.