I need to calculate the sum below where X is a matrix 2x5 and i/j is a selected column.

I've solved this with the following code, but I would like to know if there is an easier solution with numpy to solve this sum (without the for..range)
sum = 0
size = 5
for i in range(0, size):
for j in range(0, size):
if i != j:
sum = sum + np.power(np.linalg.norm(X[:, i] - X[:, j]), 2)