use .reshape(-1, 1)
import numpy as np
from sklearn.linear_model import LinearRegression
X = np.array([1, 2, 3, 4, 5]).reshape(-1, 1) # Features
y = np.array([2, 4, 6, 8, 10]).reshape(-1, 1) # Target
model = LinearRegression()
model.fit(X, y)
If you have a one dimensional array this step is mandatory.