spyder-ide / spyder

Official repository for Spyder - The Scientific Python Development Environment
https://www.spyder-ide.org
MIT License
8.21k stars 1.59k forks source link

ImportError: DLL load failed while importing _multiarray_umath: The specified module could not be found. #22384

Open sureshd2020 opened 3 weeks ago

sureshd2020 commented 3 weeks ago

Description

What steps will reproduce the problem?

As soon as it starts running python, I get these messages: ImportError: DLL load failed while importing _multiarray_umath: The specified module could not be found.

Traceback

ImportError: DLL load failed while importing _multiarray_umath: The specified module could not be found.

Versions

Dependencies

# Mandatory:
atomicwrites >=1.2.0             :  1.4.0 (OK)
chardet >=2.0.0                  :  4.0.0 (OK)
cloudpickle >=0.5.0              :  3.0.0 (OK)
cookiecutter >=1.6.0             :  2.6.0 (OK)
diff_match_patch >=20181111      :  20200713 (OK)
intervaltree >=3.0.2             :  3.1.0 (OK)
IPython >=8.13.0,<9.0.0,!=8.17.1 :  8.15.0 (OK)
jedi >=0.17.2,<0.20.0            :  0.19.1 (OK)
jellyfish >=0.7                  :  1.0.1 (OK)
jsonschema >=3.2.0               :  4.19.2 (OK)
keyring >=17.0.0                 :  24.3.1 (OK)
nbconvert >=4.0                  :  7.10.0 (OK)
numpydoc >=0.6.0                 :  1.7.0 (OK)
paramiko >=2.4.0                 :  2.8.1 (OK)
parso >=0.7.0,<0.9.0             :  0.8.3 (OK)
pexpect >=4.4.0                  :  4.8.0 (OK)
pickleshare >=0.4                :  0.7.5 (OK)
psutil >=5.3                     :  5.9.0 (OK)
pygments >=2.0                   :  2.15.1 (OK)
pylint >=2.5.0,<3.1              :  2.16.2 (OK)
pylint_venv >=3.0.2              :  3.0.3 (OK)
pyls_spyder >=0.4.0              :  0.4.0 (OK)
pylsp >=1.10.0,<1.11.0           :  1.10.0 (OK)
pylsp_black >=2.0.0,<3.0.0       :  2.0.0 (OK)
qdarkstyle >=3.2.0,<3.3.0        :  3.2.3 (OK)
qstylizer >=0.2.2                :  0.2.2 (OK)
qtawesome >=1.2.1                :  1.2.2 (OK)
qtconsole >=5.5.1,<5.6.0         :  5.5.1 (OK)
qtpy >=2.1.0                     :  2.4.1 (OK)
rtree >=0.9.7                    :  1.0.1 (OK)
setuptools >=49.6.0              :  72.1.0 (OK)
sphinx >=0.6.6                   :  7.3.7 (OK)
spyder_kernels >=2.5.0,<2.6.0    :  2.5.0 (OK)
textdistance >=4.2.0             :  4.2.1 (OK)
three_merge >=0.1.1              :  0.1.1 (OK)
watchdog >=0.10.3                :  4.0.1 (OK)
zmq >=22.1.0                     :  25.1.2 (OK)

# Optional:
cython >=0.21                    :  None (NOK)
matplotlib >=3.0.0               :  None (NOK)
numpy >=1.7                      :  1.26.4 (OK)
pandas >=1.1.1                   :  None (NOK)
scipy >=0.17.0                   :  1.13.1 (OK)
sympy >=0.7.3                    :  1.12 (OK)
sureshd2020 commented 3 weeks ago

I am trying to use pytorch and python to run a small program. I installed both using conda in Anaconda. But, I keep getting Numpy error - "ImportError: DLL load failed while importing _multiarray_umath: The specified module could not be found."

Spent over 4 hours on this problem. Any help would be appreciated. Thanks,

sureshd2020 commented 3 weeks ago

I get the same error when I type import torch on the Ipython console. The error is "The specified module could not be found. (Triggered internally at C:\cb\pytorch_1000000000000\work\torch\csrc\utils\tensor_numpy.cpp:84.) cpu = _conversion_method_template(device=torch.device("cpu"))"

dalthviz commented 3 weeks ago

Hi @sureshd2020 I would say your issue is related with having incompatible versions of numpy and pytorch installed. Did you follow the pytorch guide to install it (https://pytorch.org/get-started/locally/#anaconda)? I would suggest you to create a new conda env from an Anaconda prompt runing something like

conda create -n pytorch-env python=3.9

Then activate the created env:

conda activate pytorch-env

And then install there anything related to pytorch following there guide (choosing over the selector to get the installation command the Conda option). For example pytorch with only CPU support on Windows should be something like:

conda install pytorch torchvision torchaudio cpuonly -c pytorch

After that, try to install Spyder over the same env with something like

conda install spyder

I think there is not much we can do over the Spyder side to help you but let us know if the info above helps!

sureshd2020 commented 3 weeks ago

Thank you will try that

"Support the fight against Corruption - support "India Against Corruption".

On Wed, Aug 28, 2024 at 4:25 AM Daniel Althviz Moré < @.***> wrote:

Hi @sureshd2020 https://github.com/sureshd2020 I would say your issue is related with having incompatible versions of numpy and pytorch installed. Did you follow the pytorch guide to install it ( https://pytorch.org/get-started/locally/#anaconda)? I would suggest you to create a new conda env from an Anaconda prompt runing something like

conda create -n pytorch-env python=3.9

Then activate the created env:

conda activate pytorch-env

And then install there anything related to pytorch following there guide (choosing over the selector to get the installation command the Conda option). For example pytorch with only CPU support on Windows should be something like:

conda install pytorch torchvision torchaudio cpuonly -c pytorch

After that, try to install Spyder over the same env with something like

conda install spyder

I think there is not much we can do over the Spyder side to help you but let us know if the info above helps!

— Reply to this email directly, view it on GitHub https://github.com/spyder-ide/spyder/issues/22384#issuecomment-2313708990, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB6GAL4XVVSROH5V7AMTVTDZTT7V3AVCNFSM6AAAAABND6IOYOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMJTG4YDQOJZGA . You are receiving this because you were mentioned.Message ID: @.***>