you can skip sklear and other packages and just use numpy (which is supported in pypy now), and just do an svd of the input matrix.
U,d,Vt=svd(X)
D=diag(d)
Xhat= U[:,:2].dot(D[:2, :2])
U,d,Vt=svd(X)
D=diag(d)
Xhat= U[:,:2].dot(D[:2, :2])
l=2 # desired vector space dimension
U,d,Vt = linalg.svd(X,full_matrices=False)
P=(U*(1/d))[:,:l]
xnew = dot(x,P)