DLL load failure when importing after PyTorch
See original GitHub issueMy issue is about DLL load failure on Windows. We are using Anaconda. It is causing test jobs to fail at PyTorch: https://github.com/pytorch/pytorch/issues/40366. Currently, we are downgrading it to 1.4.1.
Reproducing code example:
pip install --pre scipy torch -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html
python -c "import torch; from scipy import stats"
Error message:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Jenkins\Miniconda3\lib\site-packages\scipy\__init__.py", line 104, in <module>
from . import _distributor_init
File "C:\Jenkins\Miniconda3\lib\site-packages\scipy\_distributor_init.py", line 61, in <module>
WinDLL(os.path.abspath(filename))
File "C:\Jenkins\Miniconda3\lib\ctypes\__init__.py", line 348, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] The specified module could not be found
Scipy/Numpy/Python version information:
1.5.0 1.18.1 sys.version_info(major=3, minor=6, micro=7, releaselevel='final', serial=0)
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:29 (20 by maintainers)
Top Results From Across the Web
from torch._C import * ImportError: DLL load failed: The ...
I've been encountering the same problem. Pytorch seems to require openmp, however this is not part of the PIP distribution. If you install ......
Read more >Windows FAQ — PyTorch 1.13 documentation
_C import * ImportError: DLL load failed: The specified module could not be found. The problem is caused by the missing of the...
Read more >Pytorch Error after installation
import torch. Microsoft Visual C++ Redistributable is not installed, this may lead to the DLL load failure.
Read more >PyTorch compiled from source for Windows is failing when ...
dll and it seems it is in intel-openmp package and $(anaconda_install)\Library\bin. I have uninstalled intel-openmp but the problem is still ...
Read more >I cannot use the pytorch that was built successfully from source
The error is caused by our poor support for MSVC OpenMP in detectron. Please build with MKL so Intel OpenMP will be used....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The
from . import __config__
could also be added to_distributor_init.py
.Also, the numpy-distutils submodule in scipy-wheels maybe needs to be bumped to recent numpy, so that the
__config__.py
snippet is updated, to useos.add_dll_directory
on python3.8 instead of PATH manipulations.Also, in numpy’s
__init__.py
,_distributor_init
is imported after__config__
, opposite to scipy. We probably should sync how all this works with Numpy.The Python 3.6 Windows DLL load issue should be fixed in the recently-released SciPy
1.5.1
, based in part on the testing in pytorch CI cross-linked above.I’ll close this tentatively, please feel free to open another issue if DLL handling still has problems in
1.5.1
.