I am experiencing weird problems with python / anaconda / sklearn. I don't know which one is the source of the problem.
The problem I'm having is that I can't execute certain sklearn code anymore. Whereas before I could execute these same code parts without any issue.
Every time it throws this error:
Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)
My python version is 3.8.8
A minimal reproducible example:
import numpy as np
X = np.array([1, 0, 2, 0, 3, 0, 4, 0]).reshape(-1, 1)
y = np.array([1, 2, 3, 4, 5, 6, 7, 8]).reshape(-1, 1)
from sklearn.linear_model import LinearRegression
lin_reg = LinearRegression()
lin_reg.fit(X, y) # this line fails
As you can see, even very uncomplicated code already causes problems.
What have I already done so far:
found the questions related to this error message on this website and read those
reinstalled anaconda (incl using anaconda-clean)
reinstalled the necessary modules
tried updating the modules
trying to find a minimal reproducible example
One of the recommendations was to look for the line of code that causes the issue. However, it seems like a more general problem: whenever I use sklearn code this happens, whereas before it just worked.
I am starting to think that some recent general Ubuntu 18.04 updates are causing the issue, however, I cannot tell.
Someone who could help me some steps in the right direction? That would be great.
Any help would be appreciated a lot!
edit:
I am getting closer to pinpointing the problem I think.
this piece of code also throws the same error message
import numpy as np
X = np.array([1, 0, 2, 0, 3, 0, 4, 0]).reshape(-1, 1)
y = np.array([1, 2, 3, 4, 5, 6, 7, 8]).reshape(-1, 1)
X = np.concatenate([np.ones(shape=[8, 1]), X], axis=1)
betas = np.invert(np.transpose(X).dot(X)).dot(np.transpose(X)).dot(y) # this line fails
indicating the problem is located within my numpy ?