0

I am using anaconda with sublime text 4 on Win11. Every thing works in the anaconda prompt, but in ST4, importing modules such as Numpy, Scipy will raise:

D:\Anaconda3\lib\site-packages\numpy\__init__.py:148: UserWarning: mkl-service package failed to import, therefore Intel(R) MKL initialization ensuring its correct out-of-the box operation under condition when Gnu OpenMP had already been loaded by Python process is not assured. Please install mkl-service package, see http://github.com/IntelPython/mkl-service
  from . import _distributor_init
Traceback (most recent call last):
  File "D:\Anaconda3\lib\site-packages\numpy\core\__init__.py", line 22, in <module>
    from . import multiarray
  File "D:\Anaconda3\lib\site-packages\numpy\core\multiarray.py", line 12, in <module>
    from . import overrides
  File "D:\Anaconda3\lib\site-packages\numpy\core\overrides.py", line 7, in <module>
    from numpy.core._multiarray_umath import (
ImportError: DLL load failed while importing _multiarray_umath...

Modules such as 'os' can be properly imported.

The path of anaconda has already been written in the settings of ST4 plugin Conda and Anaconda, as well as %PATH%.

This problem also happens on ST3 with Win10.

MattDMo
  • 100,794
  • 21
  • 241
  • 231
royzys
  • 1
  • Write a script that does `import sys; print(sys.version); print(sys.executable)` and run it in both places; do you get the same result both times, and are both the version you expect to see? – OdatNurd Aug 09 '22 at 06:49
  • `The path of anaconda has already been written in the settings of ST4 plugin Conda and Anaconda, as well as %PATH%.` Which path did you add to PATH. Your error suggests that you missed some – FlyingTeller Aug 09 '22 at 08:04
  • @OdatNurd From the error message, it seems that the anaconda installed python is used correctly, as it tries to load `D:\Anaconda3\lib\site-packages\numpy\__init__.py` – FlyingTeller Aug 09 '22 at 08:04
  • Did you install the `mkl-service` package as the first line of the error tells you to do? – MattDMo Aug 09 '22 at 17:36
  • @FlyingTeller that presumes that that path is the correct one, which isn't explicitly stated. In any case, the two main reasons for this are not using the version of Python you expect and not having set the environment required, and the one is easier to check than the other (and frankly is the most common) – OdatNurd Aug 09 '22 at 17:46
  • @MattDMo Yes, `mkl-service` can be found in the activated Anaconda environment. – royzys Aug 10 '22 at 08:49
  • @OdatNurd Currently the problem with ST4 is solved after reboot, but the other (ST3+Win10) remains. That started since weeks ago I tried to install `cv2`, I'll try the scrip later, thanks! – royzys Aug 10 '22 at 08:57
  • @royzys in that case, double check that both versions of the packages installed in Sublime are configured the same way. A reboot fixing things means that you adjusted the environment but didn't restart Sublime. If the one works and they're both configured the same, then in theory both should work since they would be both running the same stuff. – OdatNurd Aug 10 '22 at 16:56

0 Answers0