Anthony F. Troy, former Democratic Attorney general of Virginia, said yesterday he has withdrawn his name as a candidate to succeed U.S. Attorney William B. Cummings in Alexandria.

Troy, 37, said he had decided not to seek the appointment as chief federal prosecutor for the eastern district of Virginia "for professional, personal and political reasons."

Considered a front-runner by many political observers, Troy said yesterday he was bowing out in "fairness" to the other candidates being considered for the $47,500-a-year position.

The office is being vacated June 1 by Cummings, a Republican who was appointed by then-President Gerald R. Ford. Cummings plans to enter private practice.

A spokesman for the Justice Department said yesterday that a number of Democratic candidates are bring considered for the job. President Carter's final choice must be approved by Congress.

The Justice Department spokesman said it was doubtful that a candidate would be chosen by June 1. In the interim, Cummings' first deputy, Justin Williams, is expected to be appointed to the post on a temporary basis.

Troy, who served as attorney general under then-Gov. Mills Godwin, said yesterday his decision to withdraw was made "not without consideration of the support from many fine peple." Troy said he would remain a partner in the Richmond law firm of Mays, Valentine. Davenport and Moore had no immediate plans to seek political office.