Closed
Description
Bug report
Bug summary
ImportError: DLL load failed: The specified module could not be found
when importing matplotlib. On another PC it works fine, the same Python 3.7.3 and packages.
Code for reproduction
import matplotlib
Outcome
C:\Users\user1\Downloads>poetry new mpl
Created package mpl in mpl
C:\Users\user1\Downloads>cd mpl
C:\Users\user1\Downloads\mpl>poetry add matplotlib
Creating virtualenv mpl-py3.7 in C:\Users\user1\AppData\Local\pypoetry\Cache\virtualenvs
Using version ^3.1 for matplotlib
Updating dependencies
Resolving dependencies...
Writing lock file
Package operations: 16 installs, 0 updates, 0 removals
- Installing zipp (0.5.1)
- Installing importlib-metadata (0.18)
- Installing six (1.12.0)
- Installing atomicwrites (1.3.0)
- Installing attrs (19.1.0)
- Installing colorama (0.4.1)
- Installing cycler (0.10.0)
- Installing kiwisolver (1.1.0)
- Installing more-itertools (7.0.0)
- Installing numpy (1.16.4)
- Installing pluggy (0.12.0)
- Installing py (1.8.0)
- Installing pyparsing (2.4.0)
- Installing python-dateutil (2.8.0)
- Installing matplotlib (3.1.0)
- Installing pytest (3.10.1)
C:\Users\user1\Downloads\mpl>poetry run python
Python 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 22:22:05) [MSC v.1916 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\user1\AppData\Local\pypoetry\Cache\virtualenvs\mpl-py3.7\lib\site-packages\matplotlib\__init__.py", line 200, in <module>
_check_versions()
File "C:\Users\user1\AppData\Local\pypoetry\Cache\virtualenvs\mpl-py3.7\lib\site-packages\matplotlib\__init__.py", line 194, in _check_versions
module = importlib.import_module(modname)
File "C:\Users\user1\AppData\Local\Programs\Python\Python37\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ImportError: DLL load failed: The specified module could not be found.
>>> import sys
>>> print(sys.path)
['', 'C:\\Users\\user1\\AppData\\Local\\Programs\\Python\\Python37\\python37.zip', 'C:\\Users\\user1\\AppData\\Local\\Programs\\Python\\Python37\\DLLs', 'C:\\Users\\user1\\AppData\\Local\\Programs\\Python\\Python37\\lib', 'C:\\Users\\user1\\AppData\\Local\\Programs\\Python\\Python37', 'C:\\Users\\user1\\AppData\\Local\\pypoetry\\Cache\\virtualenvs\\mpl-py3.7', 'C:\\Users\\user1\\AppData\\Local\\pypoetry\\Cache\\virtualenvs\\mpl-py3.7\\lib\\site-packages']
Matplotlib version
- Operating system: Win 10 x64
- Matplotlib version: 3.1.0
- Python version: 3.7.3
Installed via pip using poetry.