'Umap import causes an exception: Numba needs NumPy 1.20 or less

I am trying to import UMAP library in my lab work, however I get an error ImportError: Numba needs NumPy 1.20 or less. Before running the code, I checked that both packages are preinstalled and both packages have the latest version. Here is my code:

# Импорт базовых библиотек
import numpy as np
import pandas as pd

# Визуализация

import seaborn as sns
import matplotlib.pyplot as plt

# Датасеты
from sklearn.datasets import load_iris  # для классификации
from sklearn.datasets import load_boston  # для регрессии

# Utils
from sklearn.model_selection import train_test_split, cross_val_score

# Модели (классификация)
from sklearn.neighbors import KNeighborsClassifier
from sklearn.ensemble import RandomForestClassifier
from sklearn.svm import SVC

# Модели (регрессия)
from sklearn.linear_model import LinearRegression, Ridge
from sklearn.ensemble import RandomForestRegressor
from sklearn.svm import SVR

# Метрики
from sklearn.metrics import accuracy_score, precision_score, recall_score, f1_score, roc_auc_score  # для классификации
from sklearn.metrics import mean_absolute_error, mean_squared_error  # для регрессии

# Misc
from sklearn.manifold import TSNE

# Для того, чтобы узнать возраст игрока
from datetime import datetime as dt

import umap

from sklearn.cluster import KMeans

I will be very thankful if you help me to solve this problem.



Solution 1:[1]

The latest version of numpy is 1.22.3 as of 5th May 2022. You will have to downgrade your numpy package

Please run the below code and it should be resolved

pip install numpy==1.20.0

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Shaurya Goyal