Its not the problem with X, You should be able to fit anything, not just int, the sample code below works. I doubt the K value you are passing is not an int, can you check? number of clusters has to be an int.
from sklearn.cluster import KMeans
import numpy as np
X = np.array([[1, 2], [1, 4], [1, 0], [10, 2], [10, 4], [10, 0]], dtype=float)
kmeans = KMeans(n_clusters=2, random_state=0).fit_predict(X)
kmeans

out: array([1, 1, 1, 0, 0, 0], dtype=int32)