The invention discloses a method and device for measuring main shaft rotary errors with the capacity of installation eccentricity separation. The device comprises a displacement sensor installation clamping device, a displacement sensor, a grating encoder, a signal cable, a data processor and a computer. According to the measurement process, measurement is conducted by the displacement sensor according to three selectable modes with three different positions of the external profile of a main shaft serving as sampling starting points, other components, except for first-order harmonic waves, of main shaft roundness errors are obtained on the basis of the three-point method principle, secondary separation is conducted according to the provided algorithm, installation eccentricity is separated from the rotary errors, and therefore a pure rotary movement error value of the main shaft is obtained. On one hand, the roundness errors of the profile of the main shaft and eccentric errors of installation of a standard ball and the sensor are separated from the rotary movement errors of the main shaft, so that the separation operand is small. On the other hand, only one displacement sensor is adopted and measurement errors caused by a sensor performance difference because of three sensors adopted in a common three-point method error separation technology are avoided.