Ноутбук Jupyter отказывается распознавать установку matplotlibPython

Программы на Python
Ответить
Anonymous
 Ноутбук Jupyter отказывается распознавать установку matplotlib

Сообщение Anonymous »

Я использую ноутбук Jupyter, и мне пришлось установить вручную с помощью pip Matplotlib 3.10.7, поскольку он не распознавался на моей Anaconda. Теперь, когда я пытаюсь получить его в Jupyter, я получаю следующую ошибку:
ModuleNotFoundError: No module named '~atplotplib'

Я попробовал следовать инструкциям здесь:
pip, как удалить неправильно установленный пакет с дефисом в начале: "-pkgname"
и успешно удалил пакет ~atplotlib, но теперь я получаю это сообщение:
Requirement already satisfied: matplotlib in c:\users\User\anaconda3\lib\site-packages (3.10.7)
Requirement already satisfied: contourpy>=1.0.1 in c:\users\User\anaconda3\lib\site-packages (from matplotlib) (1.2.0)
Requirement already satisfied: cycler>=0.10 in c:\users\User\anaconda3\lib\site-packages (from matplotlib) (0.11.0)
Requirement already satisfied: fonttools>=4.22.0 in c:\users\User\anaconda3\lib\site-packages (from matplotlib) (4.51.0)
Requirement already satisfied: kiwisolver>=1.3.1 in c:\users\User\anaconda3\lib\site-packages (from matplotlib) (1.4.4)
Requirement already satisfied: numpy>=1.23 in c:\users\User\anaconda3\lib\site-packages (from matplotlib) (1.26.4)
Requirement already satisfied: packaging>=20.0 in c:\users\User\anaconda3\lib\site-packages (from matplotlib) (24.1)
Requirement already satisfied: pillow>=8 in c:\users\User\anaconda3\lib\site-packages (from matplotlib) (10.4.0)
Requirement already satisfied: pyparsing>=3 in c:\users\User\anaconda3\lib\site-packages (from matplotlib) (3.1.2)
Requirement already satisfied: python-dateutil>=2.7 in c:\users\User\anaconda3\lib\site-packages (from matplotlib) (2.9.0.post0)
Requirement already satisfied: six>=1.5 in c:\users\User\anaconda3\lib\site-packages (from python-dateutil>=2.7->matplotlib) (1.16.0)
Note: you may need to restart the kernel to use updated packages.

---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
Cell In[449], line 16
11 # Source: must install
12 # python -mpip install -U pip
13 # python -mpip install -U matplotlib
14 # https://askubuntu.com/questions/427708/ ... -installed
15 get_ipython().run_line_magic('pip', 'install matplotlib')
---> 16 import matplotplib.pyplot as plt
17 from sklearn.metrics import confusion_matrix, ConfusionMatrixDisplay
18 from sklearn.model_selection import train_test_split

ModuleNotFoundError: No module named 'matplotplib'

хотя я явно установил его в оболочке Anaconda:
Requirement already satisfied: six>=1.5 in c:\users\User\anaconda3\lib\site-packages (from python-dateutil>=2.7->matplotlib) (1.16.0)
Using cached matplotlib-3.10.7-cp312-cp312-win_amd64.whl (8.1 MB)
WARNING: Ignoring invalid distribution ~atplotlib (C:\Users\User\anaconda3\Lib\site-packages)
Installing collected packages: matplotlib
WARNING: Ignoring invalid distribution ~atplotlib (C:\Users\User\anaconda3\Lib\site-packages)
Successfully installed matplotlib-3.10.7

(base) C:\Users\User>ls
'ls' is not recognized as an internal or external command,
operable program or batch file.

(base) C:\Users\User>pip install matplotlib
Requirement already satisfied: matplotlib in c:\users\User\anaconda3\lib\site-packages (3.10.7)
Requirement already satisfied: contourpy>=1.0.1 in c:\users\User\anaconda3\lib\site-packages (from matplotlib) (1.2.0)
Requirement already satisfied: cycler>=0.10 in c:\users\User\anaconda3\lib\site-packages (from matplotlib) (0.11.0)
Requirement already satisfied: fonttools>=4.22.0 in c:\users\User\anaconda3\lib\site-packages (from matplotlib) (4.51.0)
Requirement already satisfied: kiwisolver>=1.3.1 in c:\users\User\anaconda3\lib\site-packages (from matplotlib) (1.4.4)
Requirement already satisfied: numpy>=1.23 in c:\users\User\anaconda3\lib\site-packages (from matplotlib) (1.26.4)
Requirement already satisfied: packaging>=20.0 in c:\users\User\anaconda3\lib\site-packages (from matplotlib) (24.1)
Requirement already satisfied: pillow>=8 in c:\users\User\anaconda3\lib\site-packages (from matplotlib) (10.4.0)
Requirement already satisfied: pyparsing>=3 in c:\users\User\anaconda3\lib\site-packages (from matplotlib) (3.1.2)
Requirement already satisfied: python-dateutil>=2.7 in c:\users\User\anaconda3\lib\site-packages (from matplotlib) (2.9.0.post0)
Requirement already satisfied: six>=1.5 in c:\users\User\anaconda3\lib\site-packages (from python-dateutil>=2.7->matplotlib) (1.16.0)

(base) C:\Users\User>


Подробнее здесь: https://stackoverflow.com/questions/798 ... stallation
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «Python»