New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not able to import manifold if scikit-learn is installed directly from github in Google Colab. #11656
Comments
There's probably a mixture of versions installed right now. make sure sklearn is not installed before installing from github. |
I forgot to mention an important detail: I'm trying to install this in Google Colaboratory. I updated the title and original comment. I inserted the line I am also using a fresh runtime. You can do this by switching from GPU mode to CPU mode (some how just selecting runtime->restart keeps previous pip installations). Here is the full code I last tried
Here is the output/error message
I noticed that the 0.19.2 version was uninstalled from Colab, so perhaps Colab is somehow setup only for 0.19.2 since that version is pre-installed. |
Even without google collab, I can reproduce the import error when trying to install sklearn in some specific folder with That is not a supported way of installing / using scikit-lean. One reason why it wouldn't work is that a few modules in scikit-learn use absolute imports (e.g. You should either install it with Closing as a usage question, please comment if you disagree. |
We shouldn't use absolute imports though, right? I thought we only did that in tests? |
We do use them in tests, but also in a few python files and a number of cython files. Is there a reason we don't like absolute imports in sklearn (cf related discussion in https://stackoverflow.com/a/16748366/1791279) ? There are also some suspicious looking issues about relative I would be +1 to make all imports (excluding tests) relative for the sake of consistency (made a PR for the Python files in #11665), but I still don't think that the we want to support |
I am unable to import manifold if scikit-learn is installed directly from github in Google Colaboratory.
Here is my code
This is the error I get
If I use the 0.19.X version instead of master, it imports manifold just fine with no errors.
ie:
!pip install -t ./MODEL8 https://github.com/Santosh-Gupta/scikit-learn/archive/0.19.X.zip
The text was updated successfully, but these errors were encountered: