• Register
1 vote
62 views

Problem:

I installed scikit-learn. When I try to run again:

sudo pip install -U scikit-learn

I get this message proving again that installation is ok:

Requirement already up-to-date: scikit-learn in /home/mebegueradj/.local/lib/python2.7/site-packages

Still, I can’t import it. How to resolve this problem?

12 7 7
15,250 points

Please log in or register to answer this question.

1 Answer

0 votes

Solution:

First of all, make sure you’ve installed both the python and pip same version. As per your screenshot, I can see you’ve installed python2.7. 

In Ubuntu 16.04 and later the Python3 version of python-sklearn can be installed from the default Ubuntu repositories with the following command:

sudo apt install python3-sklearn

 

13 9 6
94,240 points

Related questions

0 votes
1 answer 63 views
63 views
I am setting up a django project and i am using python for this. I heard that the best way to this is by setting up a virtual environment. I installed my virtual environment by typing the command in my command promp by using: pip install virtualenvwrappwer-win But when I ... environment I can not start my project. I am new In django if anyone know the solution please help me to set up my project.
asked Mar 9, 2020 LizzyM 6.1k points
1 vote
1 answer 11 views
11 views
Problem: Trying to run the script on a OSX system modulenotfounderror: no module named 'sklearn.cross_validation'
asked Feb 24 Sofia Castro 4.2k points
0 votes
1 answer 39 views
39 views
I wanna use scikit-learn. I have typed pip install -U scikit-learn pip3 install sklearn to install it; but when i type $ Python >>> import sklearn it returns ImportError: No module named sklearn I followed other tutorials, but it doesn't work. Furthermore, my enviroment ... . What is the true code to type in the terminal? I tried to type python setup.py installin the terminal but it doesn't work
asked Oct 24, 2020 psandprop 2.4k points
0 votes
1 answer 86 views
86 views
I'm trying to install spaCy using pip install spacy but I'm getting the following error .. I have VS 2015 installed, and I have the following Python install .. 3.5.2 |Anaconda 2.5.0 (64-bit)| (default, Jul 5 2016, 11:41:13) [MSC v.1900 64 ... others. This is not a unique problem to this specific library but more generally anytime I try to install Python libraries that need C to build on Windows.
asked Oct 24, 2020 psandprop 2.4k points
0 votes
1 answer 783 views
783 views
I have python 3 and python 2.7 installed in my system. I am a newbee and I tried to run file : ~/usr/bin/env python 2.7  But when I try to run the file it give me an error : ~/usr/bin/env python 2.7 No such file or directory How can I check my default python version? How can I run the file? How to run the file without changing my default python version?
asked Mar 9, 2020 LizzyM 6.1k points
1 vote
1 answer 1 view
1 view
Problem: How to fix this error : modulenotfounderror: no module named 'image'
asked 3 days ago MUHAMMAD MUNEEB 80k points
0 votes
1 answer 2 views
2 views
Problem: Is anyone available to assist me and resolve this issue? Modulenotfounderror: no module named 'google.cloud'
asked 4 days ago Ifra 24.4k points
0 votes
1 answer 13 views
13 views
Problem: please help me to solve it .. modulenotfounderror: no module named 'simplejson'
asked Mar 24 Ifra 24.4k points
1 vote
1 answer 3 views
3 views
Problem: How can I deal with this problem : python modulenotfounderror: no module named
asked Mar 19 MUHAMMAD MUNEEB 80k points
0 votes
1 answer 2 views
2 views
Problem: i don’t understand about this problem anyone please help? modulenotfounderror: no module named 'cython'
asked Mar 19 Rohit kr 15k points