Secretary of State George P. Shultz is pressing for an agreement this weekend or early next week on western trade relations with the Soviet Union that would open the door to lifting of the Reagan administration's controversial pipeline sanctions, according to western European diplomats and administration sources.

Shultz reportedly is working with the ambassadors from four European countries on final details of a communique. Administration sources say there is general agreement from three of the four -- Britain, Italy and West Germany -- but that France continues to object to aspects of the proposed agreement. This has led to warnings from several officials and diplomats that any announcement of success could still be some time away.

President Reagan has spoken optimistically to campaign audiences twice in the past week about his hopes for an agreement with the Europeans that would replace the sanctions policy, which has been a disruptive issue in the Atlantic alliance and has brought sharp protests from affected industries here.

But after Reagan's remarks administration spokesmen also have stressed that there has been no shift in policy.

The pipeline sanctions were imposed by the administration in retaliation for martial law last winter in Poland. Reagan is seeking to prevent sale to the Soviet Union of U.S.-made or U.S.-licensed equipment for use in the natural gas pipeline the Soviets are building from Siberia to western Europe.

The administration says the pipeline will earn the Soviets needed cash and leave Europe too dependent on the Soviets for energy. It has imposed penalties on European companies that have continued to sell pipeline equipment. Europeans have reacted angrily, defending the pipeline and saying Reagan has no business applying U.S. law to European firms.

Administration officials said yesterday that Reagan's campaign statements reflected a basic optimism that Shultz will be able to reach an agreement rather than any certain knowledge that an agreement is in hand.

Shultz reportedly gave Reagan national security adviser William P. Clark and Defense Secretary Caspar W. Weinberger a report on the negotiations yesterday morning. Weinberger, who has been a hard-liner on the issue of East-West trade and the sanctions, is said by one official to have left the meeting in general agreement with what he heard.

The proposed agreement would contain commitments in principle on curtailing credits for the Soviet Union, limiting export of strategically important high-technology items, capping energy imports from the Soviets and continuing an embargo on selected items for the pipeline, according to the sources.

Detailed discussions on these issues would be accompanied by broader-gauged talks to be joined by Canada and Japan on a general western strategy for trade relations between the West and the Soviet bloc.

Because the agreement would represent only commitments in principle, with key details to be worked out later, some hard-liners in the administration are suspicious of it, fearing it might mean giving up or softening the leverage of the pipeline sanctions before getting a firm and detailed alternative from the Europeans.

"To lift the sanctions on the theory that we have achieved something better -- and a consensus with the Europeans would be better -- is a good thing," said one government official who has staked out a firm position on the issue. "But to do so on the basis of a broad statement of principles to be worked out later would be counterproductive. It is a long way from working out the details."

The talks currently being conducted by Shultz and Undersecretary of State Lawrence S. Eagleburger are a follow-up to broad agreements reached by NATO foreign ministers at a meeting in Canada last month to undertake studies of strategic implications of East-West trade.

The Reagan administration has said ever since the pipeline sanctions were extended to companies in Europe that they would be lifted if the Europeans were able to come up with an acceptable alternative and bring it to Washington.

The fact that the United States now has begun to take the initiative in trying to find the common ground for a consensus represents a change in tactics, if not in the goal.

Diplomats familiar with the negotiations say the key sticking point is the issue of credits, although the range of items Washington would like to put off-limits to Moscow under the heading of strategic goods also is said to be worrisome.

U.S. officials have noted in recent weeks that there has been a significant increase in the interest rate charged on loans to the Soviets and Washington now is said to be pressing for a further tightening of credit terms and a cutback in the amount of credits to be made available to Moscow to finance purchases of manufactured goods from European countries to the Soviet Union.

The range of technologies Washington would like to see banned cuts across key sectors of the electronics and computer industry, focusing on such items as semiconductors and fiber optics.

While France has been singled out by administration officials as being the major holdout, West Germany also is known to have some reservations.

"We have made offers to raise the down payments on loans and to shorten the maturity date," a diplomat in one European capital said in a telephone interview yesterday. "If there is a wish to exclude all guarantees, then there can be no credits to the Soviet Union, and that is a problem."

"Similarly, the items now banned for export to the Soviet Union now are mainly military. If this is broadened to all goods of strategic importance, this would include all energy equipment, for example. You get formulas where Europe would find itself with nothing to trade."

At the same time, there appears to be a reservoir of support for Shultz, particularly among the British and West Germans.

"Reagan will give up the sanctions only if they are replaced by other steps against the Soviet Union and Poland and we do not have an agreement yet on what to replace it, but there are some very serious efforts under way," one western European official noted.