Reputation: 33
I can't use matplotlib. I installed it with pip and it shows up in the pip list, but when I try to import it it says the module is not there. Others work, like pygame and I didn't do anything different when installing.
C:\Users\Torben>pip install matplotlib
Collecting matplotlib
Using cached matplotlib-3.4.2-cp39-cp39-win_amd64.whl (7.1 MB)
Requirement already satisfied: kiwisolver>=1.0.1 in c:\users\torben\appdata\local\programs\python\python39\lib\site-packages (from matplotlib) (1.3.1)
Requirement already satisfied: numpy>=1.16 in c:\users\torben\appdata\local\programs\python\python39\lib\site-packages (from matplotlib) (1.21.0)
Requirement already satisfied: cycler>=0.10 in c:\users\torben\appdata\local\programs\python\python39\lib\site-packages (from matplotlib) (0.10.0)
Requirement already satisfied: pillow>=6.2.0 in c:\users\torben\appdata\local\programs\python\python39\lib\site-packages (from matplotlib) (8.3.0)
Requirement already satisfied: python-dateutil>=2.7 in c:\users\torben\appdata\local\programs\python\python39\lib\site-packages (from matplotlib) (2.8.1)
Requirement already satisfied: pyparsing>=2.2.1 in c:\users\torben\appdata\local\programs\python\python39\lib\site-packages (from matplotlib) (2.4.7)
Requirement already satisfied: six in c:\users\torben\appdata\local\programs\python\python39\lib\site-packages (from cycler>=0.10->matplotlib) (1.16.0)
Installing collected packages: matplotlib
Successfully installed matplotlib-3.4.2
C:\Users\Torben>pip list
Package Version
cycler 0.10.0
kiwisolver 1.3.1
matplotlib 3.4.2
numpy 1.21.0
Pillow 8.3.0
pip 21.1.3
pygame 2.0.1
pyparsing 2.4.7
python-dateutil 2.8.1
setuptools 56.0.0
six 1.16.0
C:\Users\Torben>python
Python 3.9.6 (tags/v3.9.6:db3ff76, Jun 28 2021, 15:26:21) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
import matplotlib
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\Torben\AppData\Local\Programs\Python\Python39\lib\site-packages\matplotlib\__init__.py", line 107, in <module>
from . import _api, cbook, docstring, rcsetup
File "C:\Users\Torben\AppData\Local\Programs\Python\Python39\lib\site-packages\matplotlib\rcsetup.py", line 24, in <module>
from matplotlib import _api, animation, cbook
File "C:\Users\Torben\AppData\Local\Programs\Python\Python39\lib\site-packages\matplotlib\animation.py", line 34, in <module>
from PIL import Image
File "C:\Users\Torben\AppData\Local\Programs\Python\Python39\lib\site-packages\PIL\Image.py", line 114, in <module>
from . import _imaging as core
ImportError: DLL load failed while importing _imaging: Das angegebene Modul wurde nicht gefunden.`][1]
(last line -> DLL load failed while importing _imaging: The specified module was not found.)
Upvotes: 3
Views: 194
Reputation: 161
Probably the C++ runtime library is not installed in your machine or environment. Try python -m pip install msvc-runtime
Upvotes: 2