-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
mglearn error #175
Comments
Also getting the same issue. I made sure I installed ImportError Traceback (most recent call last)
Cell In[24], line 4
2 import matplotlib.pyplot as plt
3 import pandas as pd
----> 4 import mglearn
5 from IPython.display import display
File [c:\Users\jangboo.lee\Documents\python_projects\personal\introduction_to_ml_with_python\mglearn\__init__.py:1](file:///C:/Users/jangboo.lee/Documents/python_projects/personal/introduction_to_ml_with_python/mglearn/__init__.py:1)
----> 1 from . import plots
2 from . import tools
3 from .plots import cm3, cm2
File [c:\Users\jangboo.lee\Documents\python_projects\personal\introduction_to_ml_with_python\mglearn\plots.py:5](file:///C:/Users/jangboo.lee/Documents/python_projects/personal/introduction_to_ml_with_python/mglearn/plots.py:5)
3 from .plot_animal_tree import plot_animal_tree
4 from .plot_rbf_svm_parameters import plot_svm
----> 5 from .plot_knn_regression import plot_knn_regression
6 from .plot_knn_classification import plot_knn_classification
7 from .plot_2d_separator import plot_2d_classification, plot_2d_separator
File [c:\Users\jangboo.lee\Documents\python_projects\personal\introduction_to_ml_with_python\mglearn\plot_knn_regression.py:7](file:///C:/Users/jangboo.lee/Documents/python_projects/personal/introduction_to_ml_with_python/mglearn/plot_knn_regression.py:7)
4 from sklearn.neighbors import KNeighborsRegressor
5 from sklearn.metrics import euclidean_distances
----> 7 from .datasets import make_wave
8 from .plot_helpers import cm3 |
Env:
Quick fix:
# original code
mask = np.ones(len(X), dtype=np.bool)
# modified code
mask = np.ones(len(X), dtype=np.bool_) |
Thank you, I confirm that the fix is working on my environment (Windows/Python 3.11/virtual environment/VS Codium)! |
Hello! How to find where is the mglearn/datasets.py located? |
Hi,
I am not able to practice the codes in the book because I am stuck with importing mglearn. (I am using PyCharm). Here is the error message I receive:
Traceback (most recent call last):
File "/Users/sebgok/PycharmProjects/Book/sampleDatasets.py", line 4, in
import mglearn
File "/Users/sebgok/PycharmProjects/Book/venv/lib/python3.8/site-packages/mglearn/init.py", line 1, in
from . import plots
File "/Users/sebgok/PycharmProjects/Book/venv/lib/python3.8/site-packages/mglearn/plots.py", line 2, in
from .plot_interactive_tree import plot_tree_progressive, plot_tree_partition
File "/Users/sebgok/PycharmProjects/Book/venv/lib/python3.8/site-packages/mglearn/plot_interactive_tree.py", line 6, in
from sklearn.externals.six import StringIO # doctest: +SKIP
ModuleNotFoundError: No module named 'sklearn.externals.six'
The text was updated successfully, but these errors were encountered: