Pope John Paul II, cheered by millions of exuberant and dancing Mexicans, drove to the Shrine of Guadalupe today to open a conference of Latin American bishops with an exhortation against leftist activism of some Roman Catholic leaders.

But his speech was moderate in tone as the pontiff sought the middle ground between embattled conservative and liberal clergy, emphasizing unity rather than criticism of extremists on either side.

While the pope spoke at a mass inside the Shrine of Guadalupe, on the outskirts of the city, crowds estimated by police at nearly 2 million pushed and screamed outside in a human sea that threatened to break down the tall fences surrounding the church that the faithful consider the most holy site in Mexico.

Parents attempted to haul their children above their heads to avoid their being crushed. Numerous people, who apparently either fainted from the heat or were injured in the pushing mass, were carried away on Red Corss stretchers.

The pontiff arrived at the shrine via a parade route several miles long through the central city, where huge crowds lined every available inch of viewing space. Many burst into tears as he passed in an open vehicle, frantically crossing themselves and crying his name.

Others waved white and yellow Vatican flags and cheered, "Bless us Father, bless our home."

As John Paul entered the shrine's large courtyard, his entourage was transferred to a small, float-like vehicle with chest-high glass sides. Still, he reached over to bless people and at one point lifted a young boy over the side and carried him a short distance in his arms before kissing his head and lowering him back to his parents.

The crowds were kept in order to some extent by thousands of unarmed uniformed police, as well as young men from the army's special "Black Beret" corps wearing civilian clothes. Confusion reigned, althoush security seemed much tighter than yesterday, when special public and press tickets to the pope's first mass in Mexico proved useless as thousands simply kicked and shoved their way into the Metropolitan Cathedral. today, muscular guards were so vigilant against gate crashers that many with tickets to the Guadalupe mass were kept outside the gate. Those who got inside the courtyard, but could not make it inside the church, were then prohibited from leaving the grounds by guards who refused to open the heavy gates even an inch for fear of the pressing mass of humanity outside.

While tear gas and mace wer reportedly used on crowds outside the cathedral yesterday, there were no reliable reports of their use today.

The pope's second day in Mexico began at 7:15 a.m. when a delegation of 100 Mexican youths serenaded outside his windown in the apostolic delegation building with folkloric music that he described as "the most beautiful songs in the world." He asked for a repeat performance of "Guadalajara," and the youths obliged.

Later this morning, the former cardinal of Krakow met with 300 representatives of the Mexican Polish community before beginning his two-hour drive through the city. Several Americans of Polish origin who said they had traveled here to see "their" pope stood in the crowd at the shrine.

Despite several anxious moments yesterday and today, when masses of people got close enough to the pope to grab his hand and threaten to crush him, John Paul appeared to have maintained a level of good humor. At the very least, he has kept a fairly constant smile when faced with frenzied millions.

Today's Guadalupe speech officially opened the two-week Conference of Latin American Bishops, which will take place in the city of Puebla, 65 miles from here.

The more than 300 delegates to the conference, including 218 Latin American cardinals, archbishops and bishops, were listening carefully for some clue as to what direction the pope will give to the gathering he officially heads.

The pontiff's reference to "contradictory, not always correct" interpretation of doctrine that is "not always beneficial for the church" was obviously directed toward the so called "theology of liberation" practiced by activist leftist priests in rightist-ruled countries.

Still, he pointedly reaffirmed the resolutions taken at the last bishops' conference in Medellin, Columbia in 1968.

The Medellin conference called on the Catholic clergy to show "preferential yet not exclusive love for the poor" and encouraged an active church role in bettering their social and economic conditions.

Differing interpretations of how to achieve that goal among the Latin Catholic clergy range from those who seek to preserve the status quo through a broad middle ground believing in strong but nonviolent activism, to avowedly Marxist priests whjo believe that violent change is the only recourse for Latin America's poor.

Today, John Paul called the Medellin resolutions a "point of departure" for the future.

"We wish," he said, "on the basis of the experiences of the last 10 years and of the development of thought and in light of the experience of the whole church, to take a correct and necessary step forward."

The speech had a little for both sides of the controversy, and scant substance for either side to use as support of its position. In many ways, it was a repetition of John Paul's view, now stated several times during the trip, that there is no "new church" or "old church."

There is, he reminded the faithful today, the unchanging "truth and the law" calling for all, "whether they are rulers or subjects," to "learn to live in peace, educate themselves for peace, and do what is demanded by justice and respect for the rights of every person, so that peace may by established."

How the bishops will interpret this somewhat vague instruction will be determined during their working sessions during the next two weeks at Puebla.

The pope also repeated another theme he has struck throught his first trip abroad -- that of the reemergence of the Virgian Mary as a focal point in Catholic doctrine.

Today's talk was couched in numerous references to the Virgin and appeals for her guidance.

The shrine of Guadalupe is revered as the site of a 16th century miracle in which a peasant is believed to have seen a vision of Mary. Considered by Catholics the most holy place in Mexico, and by many the most sacred shrine in all of Latin America, it is a grouping of churches around a small hill on which the miracle is said to have orcurred.

From the oldest church, built on top of the hill, the peaseant's cloak, on which the faithful believe the virgin's image is imprinted, has been successively moved to newer buildings. Two years ago, it wa transferred to the newest church, a large, contemporary structure in which today's mass was celebrated.

On Sunday, the pope will travel to Puebla to meet with the bishops in a conference working session.