Import Fancyimpute error

Kenobi, we now have a more elegant method of posting traceback errors for a more civilized age of asking for help.
Please don’t use screenshots. And please don’t post a fraction of the information as it makes it harder for those in the community to help you.
For posting the traceback as copied text learn about posting code blocks between triple back ticks, see the ‘Block Code’ section here, in particular look at how to do it below the text that says “Another (short) example, to demonstrate how to wrap your code blocks”. Discourse makes this easy; however, if you feel the traceback is long you can post it in a gist or a code snippet site and link to it in your post as well.

Also please review Getting good answers to your questions.

You don’t describe how you installed Jupyter notebook? How you installed cvxpy? Conda or pip? What type of machine you are on? Etc.?

Testable code examples would also be very nice to include in the future. That way we can test things are working in a fresh environment. They don’t have to be your code even, just related examples that involve imports of the same items.


That being said, my guess based on the limited information provided seems to be incompatibility with packages in your environment. Based on an open similar issue in the Issues listing for cvxpy and forcing an update, I’d suggest starting by installing cvxpy again by running the following at the following in a new cell right near the top of your notebook:

%pip install --upgrade --force-reinstall cvxpy

Following running that code, restart the kernel for the notebook, and then try running your code again.

If that simple approach fails, based on a very similar issue on StackOveflow here try to make more of the packages consistent. Maybe something like this in a new cell at the top:

%pip install --upgrade --force-reinstall numpy
%pip install --upgrade --force-reinstall scipy
%pip install --upgrade --force-reinstall cvxpy
%pip install --upgrade --force-reinstall fancyimpute

The fresh installs will hopefully make everything current and compatible in the notebook’s environment.

1 Like