TOKYO (AP) _ A political crisis just weeks before it welcomes a meeting of the richest industrialized nations has deeply embarrassed a nation still searching for a leadership role in the world.

For trading partners trying to get Japan to open its markets and stimulate its sluggish economy, Prime Minister Kiichi Miyazawa's defeat on a no- confidence motion Friday is especially bad news.

From Japan's point of view, the timing could not be worse. The governing Liberal Democrats, torn by internal rebellion and discredited by corruption scandals, face their strongest challenge in almost four decades of power.

In this culture, being a host is a heavy responsibility. The spectacle of a political brawl just before the guests arrive is enough to cause paroxysms of shame.

''Japan must not let its obligations slip as host nation,'' said Yohei Kono, the chief Cabinet secretary.

For months, Japan has been laying groundwork for the July 7-9 summit, the first Group of Seven meeting in Tokyo since 1986.

To make sure it goes smoothly, the government is preparing a huge security operation and working hard to stake out its positions in such a way as to avoid bruising confrontations.

Because of all that, the political strife set off a round of hand-wringing over its international image that is symptomatic of Japan's sensitivity about its stature.

''The whole world is watching,'' political commentator Minoru Morita told a television audience.

On the other hand, since most of the summit details are being handled by bureaucrats, not politicians, the political turmoil may not have much effect on the proceedings.

Mamoru Ozaki, the vice finance minister, predicted the summit would proceed ''without a hitch.'' However, Foreign Minister Kabun Muto said: ''It's only natural that it would be better that the summit be held under normal circumstances.''

Japan can find some consolation in the fact that other G-7 countries have had rough sailing of their own lately.

In the United States, the Clinton administration is trying to get back on track after stumbles over everything from high-priced haircuts on Air Force One to uncertainty about high-level appointments.

Chancellor Helmut Kohl's German government has been criticized for its handling of right-wing violence against foreigners.

Italy has suffered corruption scandals that dwarf even Japan's in scope, and shaken by terror bombings in Rome and Florence.

Britain's beleaguered prime minister, John Major, was excoriated in Parliament by the treasury chief he dismissed, leading to speculation about how long he can survive.

The new conservative government of France is wrestling with a staggering deficit, and the suicide of former Premier Pierre Beregovoy cast a shadow on politics.

Kim Campbell, who becomes the new prime minister of Canada this month, had to beat back a strong challenge to become leader of her Progressive Conservative Party.

Russia is not a G-7 partner, but its woes are high on the summit agenda. Parliamentary elections could be held as early as September, and President Boris Yeltsin has been fending off challenges from the Communist-dominated Congress of People's Deputies and archrival Ruslan Khasbulatov.

Despite the political turmoil in Japan, Foreign Ministry spokesman Masamichi Hanabusa promised ''a calm atmosphere'' for the G-7 meeting.

But a certain awkwardness is inevitable, given the abuse heaped on Miyazawa, who is being blamed personally for failing to clean up Japan's dirty politics.

''The responsibility of the prime minister is heavy indeed,'' the newspaper Asahi newspaper said in an editorial. ''There is no getting around the fact that he ignored the problems engulfing Japanese politics.''

5EDT