PARIS — All week President Emmanuel Macron toured France’s World War I memory trail. He visited the killing fields of Verdun, the vast ossuary at Douaumont and the monument to heroic African soldiers at Reims. Each stop made the same solemn point: Nationalism kills.

It is a message Mr. Macron hopes will not be lost on the dozens of world leaders who will descend on France this weekend to commemorate the 1918 Armistice.

But it is not clear anyone is listening. If anything, the carefully orchestrated centennial that Mr. Macron wanted to use for boosting his image at home and his ambitions for Europe only seems certain to underscore his isolation, both at home and abroad.

The partner he had hoped to have in realizing his ambition for ‘‘more Europe’’ — the German chancellor, Angela Merkel — is on her way out. The avidly nativist eastern Europeans see him as the symbol of everything that is wrong with the European Union. He extended a hand time and again to President Trump only to see it slapped away; in the last few months, Mr. Macron has increasingly been marking his distance from the American president.

All that has left Mr. Macron as perhaps the lone leader defending liberal values and European governance, and taking a moderate stance toward immigrants against flag-waving populists.

But the heir-apparent to lead Europe as Ms. Merkel exits is politically weak at home, still inexperienced as a politician, nearly outnumbered by populist leaders whose ranks are growing quickly on the Continent and lacks a partner on the world stage.

Some of this isolation, no doubt, stems from genuine conviction in the face of countervailing political winds. The Europe that Mr. Macron looks to lead is very different from the one where Ms. Merkel rose to power.

When in 2005 she became chancellor, and the leader of Europe by dint of her running its wealthiest country, other nations were still clamoring to join the European Union. The great immigration waves from the Middle East and sub-Saharan Africa which have so riven the continent politically only started in 2011 and did not reach deeply divisive levels until 2014.

It’s a different situation for Mr. Macron, elected in 2017.

“It’s absolutely clear that he’s pretty isolated, because he represents the idea of a world that’s open — multilateralism, defending liberal society,” said Nicolas Tenzer, an analyst who teaches at Sciences Po, one of France’s top academic institutions. From Mr. Macron’s point of view, “you’ve got to reaffirm these principles,’’ he said.

But some of Mr. Macron’s isolation is also a function of his favored self-image as a solitary warrior, creating a stark choice between himself and the French far right for next May’s elections for the European Parliament, which are shaping up as a battle between the forces of integration and fragmentation on the Continent.

Even at home, Mr. Macron has some persuading to do. This week, for the first time in the race, a poll showed the president’s political movement, La République en Marche, or Republic on the Move, falling slightly behind the anti-Europe, far-right Rassemblement National, formerly known as the National Front, in the race for European Parliament seats.

Several analysts see a direct link between the increasing disaffection of French citizens with their leader, and his isolation in the world. Unlike Ms. Merkel, who for most of her term was quite popular and at times even beloved at home, Mr. Macron’s youthful appeal waned as he pushed through one reform after another, which have yet to yield much economic improvement for those people who fear being left behind.

“He has been insensitive to the kinds of popular concerns that make people feel they are drowning,” said Pascal Perrineau, a political-science professor at Sciences Po.

Marielle de Sarnez, a Macron ally and chairwoman of the French Parliament’s foreign affairs committee, said the French president was not isolated, but that Europe’s populists were “responding to the people’s fears, that we and President Macron have to take into account.’’

“It is not a lost fight,’’ she added. ‘‘But it’s our responsibility to take into account the fears of the people and identify, for instance, the frontiers. And he’s got a very important role in that. The European peoples, it is up to us to pull them together.”

But Mr. Macron himself has become a divisive figure for many in France who fear a widening gap between the haves and have-nots, and between tradition and change.

A political opponent of Mr. Macron, Xavier Bertrand, who is president of the heavily industrialized region in the north of France, described Mr. Macron as fanning the flames of division.

“The role of a president is to reduce these fractures and bring people together rather than dividing them,” he said in an interview in the Journal du Dimanche last weekend.

Nevertheless, in recent speeches and interviews, Mr. Macron has presented himself as the best alternative for Europe’s future as he has warned about the dangers of the increasingly loud siren song of nationalism.

“I’m struck by the resemblance between the moment we’re now living, and the period between the world wars,” Mr. Macron told the newspaper Ouest-France last week in a comparison that sparked anguished commentary.

Europe was caught between “dismemberment by the leprosy of nationalism, and being pushed around by outside powers,” he said.

Nationalism “is rising, the nationalism that demands the closing of frontiers, which preaches rejection of the other. It is playing on fears, everywhere,” he told Europe1 radio this week. Europe’s postwar peace and prosperity was merely “a golden parenthesis in our history,” he said.

But some say those characterizations miss the point of contemporary Europe’s grievances, which are less militaristic than before the world wars and more rooted in fear of how immigration is changing societies.

“Macron wants to polarize the debate,” said Dominique Reynié, a political scientist at Sciences Po and a specialist in populism.

“How can you imagine that Europe is in the 1930s now?’’ he said. ‘‘Countries like Hungary are disappearing demographically. No, on questions like immigration, the Europeans are simply demanding more protection.”

But if Mr. Macron is to truly take on the role as the premier defender of Western liberal values, it becomes ever more incumbent on him to make an effort to bring his opponents into his camp even as he makes clear where his priorities differ.

Ms. Merkel never allowed herself to dramatize differences. Although she was unsparing in her criticisms of Spain, Italy and Greece, she sought to negotiate with her opponents and those who resented her policies, including Alexis Tsipras, the Greek leader. Mr. Macron, in contrast, relishes his chances to be tough and confrontational with those he perceives as antagonistic.

He has openly sparred with the Hungarian leader, Viktor Orban, as well as Italy’s interior minister, Matteo Salvini. And his speech at the United Nations General Assembly in September, closely following Mr. Trump’s, sounded like a direct rebuke of the American president’s nationalism.

In September, after Mr. Orban placed Mr. Macron “at the head of those forces upholding immigration” Mr. Macron shot back: “If they want to see me, personally, as their principal opponent, they are absolutely right.”

“He is surprisingly isolated in Europe, he’s not talking to Hungary and Poland, he’s trying to isolate them and reinforcing the idea that the French do not like the Central Europeans,” said Charles Grant, the director of the Center for European Reform in London.

The isolation from those countries, coupled with Italy’s latest turn to populism, leaves France with few, if any, powerful allies. Germany is working out its post-Merkel political stance but is moving in a more conservative direction, at least on the pivotal issue of immigration, and Britain is leaving the European Union altogether.

“He’s got a rather Manichaean view of good fighting evil and he wants to be the liberal global order fighting nationalism, but it’s risky because if the bad guys do rather well, if the nativists are the biggest group in the European Parliament, he’ll have egg on his face,” Mr. Grant added.

Mr. Macron, however, has been thinking about these division for some months and appears to have calculated they will work to his political advantage. Last summer he described “the real frontier” in the European Union as the one between the progressives and the nationalists.

For many, however, that is a misleading way to frame the current debate — whether inside or outside France.

“The divisions in the European Union are just much more complex than this very black and white vision,” said Alexandra de Hoop Scheffer, who heads the German Marshall Fund’s Paris office.

Mr. Macron, too, has some populist and even nationalist stances,” she said, noting that Ms. Merkel was heavily criticized in France for having fueled populism with her insistence on austerity measures and her open approach to immigration.

Plus, he faces the reality that Europe can no longer count on the United States in the way that it once could to help bolster its global position.

Both the United States and Russia appear to want a weaker European Union so that they can make bilateral deals and, as the more powerful partners, call the shots.

Despite all that, Europe right now is a continent in need of a leader, said Mr. Perrineau of Sciences Po.

“Macron is isolated, he is alone, he is solitary, but he has talent and there is an urgency for him to find support from other countries,” Mr. Perrineau said.

“He must find it, he cannot fight alone, there is a need for young leadership, for someone to speak up for democracy, for Europe, for openness,” he added. “If no one does, the future will be bleak.”