As a great practice of building a community of shared future for mankind, the Belt and Road Initiative is facing geopolitical risk brought by great power games, regional conflicts and terrorism. It is an important mission of geopolitical research to scientifically deal with the geopolitical risk along the Belt and Road. This study systematically constructs the geopolitical risk assessment index system and analyzes the spatiotemporal evolution, obstacle factors and risk types of geopolitical risk of countries along the Belt and Road by using the entropy weight TOPSIS model, obstacle degree model and minimum variance method. The research results showed that: (1) From 2005 to 2020, the polarization of geopolitical risk in countries along the Belt and Road was very significant, and the overall trend of geopolitical risk tended to deteriorate. (2) The Middle East and Eastern Europe were the most important geopolitical risk zones along the Belt and Road, and Afghanistan, Iraq, Russia and Ukraine were the main high geopolitical risk centers, with significant risk spillover effects from these centers. (3) Terrorism and close relations with the United States were the most important obstacle factors for geopolitical risk in countries along the Belt and Road, and military intervention politics, trade dependence degree and foreign debt burden were important obstacle factors for geopolitical risk in countries along the Belt and Road. (4) Geopolitical risk along the Belt and Road can be divided into sovereign risk dominant type, sovereign and military risk dominant type, sovereign and major power intervention risk dominant type, and sovereign and military and major power intervention risk jointly dominated type, among which sovereign and military and major power intervention risk jointly dominated type was the most important geopolitical risk type. In order to scientifically deal with geopolitical risk in countries along the Belt and Road, it is necessary to strengthen geopolitical risk awareness, pay attention to the dominant geopolitical risk factors, strengthen the control of regional geopolitical risk spillover and formulate reasonable risk prevention and control scheme based on geopolitical risk types.