PyImageSearch / Deep-Learning-for-Computer-Vision-with-Python

2 stars 1 forks source link

ImportError: No module named sklearn.preprocessing #3

Closed axlev closed 3 years ago

axlev commented 3 years ago

Are you using one of our development environments?

Yes. I am using VM, downloaded about a week ago.

If you are using your own development environment then please provide the following details.

N/A

Describe the issue

Running chapter 7's knn.py I am getting error:

ImportError: No module named sklearn.preprocessing

Any other information

Looking into the problem, I realized that actually I need to run:

"python3 knn.py --dataset ../datasets/animals" and not as instructed in the book "python knn.py --dataset ../datasets/animals"

As default python version is 2.7.

sayakpaul commented 3 years ago

You first need to activate the Python virtual environment to start working with the chapters. You can run the lsvirtualenv command to see a list of the Python virtual environments present there.