OSError: [WinError 126] after installation on Windows10

I was running into a problem after installing rasa in Windows10 python3.7.9 pip20.1.1. When I run rasa init (or any rasa command) it gives this error.

> Traceback (most recent call last):
>   File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2544.0_x64__qbz5n2kfra8p0\lib\runpy.py", 
> line 193, in _run_module_as_main
>     "__main__", mod_spec)
>   File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2544.0_x64__qbz5n2kfra8p0\lib\runpy.py", 
> line 85, in _run_code
>     exec(code, run_globals)
>   File "D:\Simulator_selfplay\venv\Scripts\rasa.exe\__main__.py", line 4, in <module>
>   File "d:\simulator_selfplay\venv\lib\site-packages\rasa\__main__.py", line 10, in <module>
>     from rasa.cli import (
>     from rasa.validator import Validator
>   File "d:\simulator_selfplay\venv\lib\site-packages\rasa\validator.py", line 5, in <module>
>     from rasa.core.featurizers.tracker_featurizers import MaxHistoryTrackerFeaturizer
>   File "d:\simulator_selfplay\venv\lib\site-packages\rasa\core\featurizers\tracker_featurizers.py", line 12, in <module>
>     from rasa.core.featurizers.single_state_featurizer import SingleStateFeaturizer
>   File "d:\simulator_selfplay\venv\lib\site-packages\rasa\core\featurizers\single_state_featurizer.py", line 3, in <module>
>     import scipy.sparse
>   File "d:\simulator_selfplay\venv\lib\site-packages\scipy\__init__.py", line 136, in <module>
>     from . import _distributor_init
>   File "d:\simulator_selfplay\venv\lib\site-packages\scipy\_distributor_init.py", line 61, in <module>
>     WinDLL(os.path.abspath(filename))
>   File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2544.0_x64__qbz5n2kfra8p0\lib\ctypes\__init__.py", line 364, in __init__
>     self._handle = _dlopen(self._name, mode)
> OSError: [WinError 126] The specified module could not be found

Installation was successful except for the error ERROR: tensorflow 2.3.1 has requirement numpy<1.19.0,>=1.16.0, but you'll have numpy 1.19.2 which is incompatible. To avoid this I have downgraded numpy to version1.18.5 and installed again and no errors were encountered thereafter. Any help will be appreciated to solve this WinError 126.

I have solved the issue by downgrading scipy1.5.2 to scipy1.4.1. There is a problem with the new release of scipy. For those who will encounter this issue try

python -m pip uninstall scipy
python -m pip install scipy==1.4.1

Link to the original source - OSError: [WinError 126] The specified module could not be found · Issue #241 · ultralytics/yolov5 · GitHub

2 Likes

Thanks for sharing the solution! I was having the same problem.