I installed numpy and tensorflow using Anaconda. However, anytime I try to import any of them I receive an error which says: dll load failed
I have tried it on VSCode and PyCharm. I also tried installing everything over again. I tried copying the long path given by Anaconda to my system environment variable but nothing seems to be working and I keep getting this:
Traceback (most recent call last):
File "c:/Users/AYERHAN MSUGHTER/Desktop/Anaconda 3/test.py", line 1, in <module>
import numpy as np
File "C:\Users\AYERHAN MSUGHTER\AppData\Local\conda\conda\envs\machinenv\lib\site-packages\numpy\__init__.py", line 140, in <module>
from . import _distributor_init
File "C:\Users\AYERHAN MSUGHTER\AppData\Local\conda\conda\envs\machinenv\lib\site-packages\numpy\_distributor_init.py", line 34, in <module>
from . import _mklinitImportError: DLL load failed: The specified module could not be found.
PS C:\Users\AYERHAN MSUGHTER\Desktop\Anaconda 3>
Related
I am using the Anaconda distribution with Python 3.9. Among the packages installed, I have numpy, pandas, etc. In PyCharm IDE, I have set the Project Interpreter to be the path to the python.exe installed with Anaconda: C:\Users\nguye\anaconda3\envs[Tensorflow]\pythonw.exe
P.S: I have tried every method to fix this problem on stack overflow from including more paths to uninstall and reinstall but none of those work. Please help!
C:\Users\nguye\anaconda3\envs\[Tensorflow]\pythonw.exe C:/Users/nguye/PycharmProjects/tensorEnv/main.py
Traceback (most recent call last):
File "C:\Users\nguye\anaconda3\envs\[Tensorflow]\lib\site-packages\numpy\core\__init__.py", line 23, in <module>
from . import multiarray
File "C:\Users\nguye\anaconda3\envs\[Tensorflow]\lib\site-packages\numpy\core\multiarray.py", line 10, in <module>
from . import overrides
File "C:\Users\nguye\anaconda3\envs\[Tensorflow]\lib\site-packages\numpy\core\overrides.py", line 6, in <module>
from numpy.core._multiarray_umath import (
ImportError: DLL load failed while importing _multiarray_umath: The specified module could not be found.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\nguye\PycharmProjects\tensorEnv\main.py", line 3, in <module>
import tensorflow
File "C:\Users\nguye\anaconda3\envs\[Tensorflow]\lib\site-packages\tensorflow\__init__.py", line 37, in <module>
from tensorflow.python.tools import module_util as _module_util
File "C:\Users\nguye\anaconda3\envs\[Tensorflow]\lib\site-packages\tensorflow\python\__init__.py", line 37, in <module>
from tensorflow.python.eager import context
File "C:\Users\nguye\anaconda3\envs\[Tensorflow]\lib\site-packages\tensorflow\python\eager\context.py", line 26, in <module>
import numpy as np
File "C:\Users\nguye\anaconda3\envs\[Tensorflow]\lib\site-packages\numpy\__init__.py", line 144, in <module>
from . import core
File "C:\Users\nguye\anaconda3\envs\[Tensorflow]\lib\site-packages\numpy\core\__init__.py", line 49, in <module>
raise ImportError(msg)
ImportError:
IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.
We have compiled some common reasons and troubleshooting tips at:
https://numpy.org/devdocs/user/troubleshooting-importerror.html
Please note and check the following:
* The Python version is: Python3.9 from "C:\Users\nguye\anaconda3\envs\[Tensorflow]\pythonw.exe"
* The NumPy version is: "1.22.2"
and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.
Original error was: DLL load failed while importing _multiarray_umath: The specified module could not be found.
Process finished with exit code 1
I want to open an image in python script but when importing skimage.io I get the following error. I have installed pip install scikit-image several times but I always get this error. Can anyone help me?
Traceback (most recent call last):
File "C:/Users/Admin/Desktop/BA Code/PSR-Staining/main.py", line 9, in
import skimage.io
File "C:\Users\Admin\Desktop\BA Code\PSR-Staining\venv\lib\site-packages\skimage_init_.py", line 127, in
from .util.dtype import (img_as_float32,
File "C:\Users\Admin\Desktop\BA Code\PSR-Staining\venv\lib\site-packages\skimage\util_init_.py", line 17, in
from ._map_array import map_array
File "C:\Users\Admin\Desktop\BA Code\PSR-Staining\venv\lib\site-packages\skimage\util_map_array.py", line 2, in
from ._remap import _map_array
ImportError: DLL load failed while importing _remap: The given module is not found.
Can you try pip install msvc-runtime? See discussion here.
I am testing my numpy installation. In Python prompt I tried writing import numpy. However it is giving the below error. I am using Anaconda. I had installed numpy using conda command conda install numpy
Python version 3.7.7
numpy version 1.18.1
OS is Win 10
Log:
>>> import numpy
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\lib\site-packages\numpy\core\__init__.py", line 24, in <module>
from . import multiarray
File "C:\ProgramData\Anaconda3\lib\site-packages\numpy\core\multiarray.py", line 14, in <module>
from . import overrides
File "C:\ProgramData\Anaconda3\lib\site-packages\numpy\core\overrides.py", line 7, in <module>
from numpy.core._multiarray_umath import (
ImportError: DLL load failed: The specified module could not be found.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\ProgramData\Anaconda3\lib\site-packages\numpy\__init__.py", line 142, in <module>
from . import core
File "C:\ProgramData\Anaconda3\lib\site-packages\numpy\core\__init__.py", line 54, in <module>
raise ImportError(msg)
ImportError:
IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
Importing the numpy c-extensions failed.
- Try uninstalling and reinstalling numpy.
- If you have already done that, then:
1. Check that you expected to use Python3.7 from "C:\ProgramData\Anaconda3\python.exe",
and that you have no directories in your PATH or PYTHONPATH that can
interfere with the Python and numpy version "1.18.1" you're trying to use.
2. If (1) looks fine, you can open a new issue at
https://github.com/numpy/numpy/issues. Please include details on:
- how you installed Python
- how you installed numpy
- your operating system
- whether or not you have multiple versions of Python installed
- if you built from source, your compiler versions and ideally a build log
- If you're working with a numpy git repository, try `git clean -xdf`
(removes all files not under version control) and rebuild numpy.
Note: this error has many possible causes, so please don't comment on
an existing issue about this - open a new one instead.
Original error was: DLL load failed: The specified module could not be found.
I have installed Python 3.7, and I have been working in Python for a while. It was working all fine and suddenly from this afternoon, I am unable to load any Python libraries. I have tried to uninstall and install entire libraries and Python itself. It has not fixed the issue yet. Could someone help on what else to be looked at. I have been using pip3 to install packages. I am not using Anaconda. I was able to install the package successfully but unable to load for some reason. When I try to load numpy, I am getting below mentioned error
import numpy
Traceback (most recent call last):
File "C:\Users\chango3\AppData\Local\Programs\Python\Python37\lib\site-packages\numpy\core\__init__.py", line 16, in <module>
from . import multiarray
ImportError: DLL load failed: The network path was not found.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\chango3\AppData\Local\Programs\Python\Python37\lib\site-packages\numpy\__init__.py", line 142, in <module>
from . import add_newdocs
File "C:\Users\chango3\AppData\Local\Programs\Python\Python37\lib\site-packages\numpy\add_newdocs.py", line 13, in <module>
from numpy.lib import add_newdoc
File "C:\Users\chango3\AppData\Local\Programs\Python\Python37\lib\site-packages\numpy\lib\__init__.py", line 8, in <module>
from .type_check import *
File "C:\Users\chango3\AppData\Local\Programs\Python\Python37\lib\site-packages\numpy\lib\type_check.py", line 11, in <module>
import numpy.core.numeric as _nx
File "C:\Users\chango3\AppData\Local\Programs\Python\Python37\lib\site-packages\numpy\core\__init__.py", line 26, in <module>
raise ImportError(msg)
ImportError:
Importing the multiarray numpy extension module failed. Most
likely you are trying to import a failed build of numpy.
If you're working with a numpy git repo, try `git clean -xdf` (removes all
files not under version control). Otherwise reinstall numpy.
Original error was: DLL load failed: The network path was not found.
Any help would be appreciated
Following is the list of modules I am using:
import sys
import cv2
import numpy as np
import pytesseract
from PIL import Image
from sklearn.cluster import MeanShift, estimate_bandwidth
from sklearn.datasets.samples_generator import make_blobs
import re
import jellyfish
Exception
Traceback (most recent call last):
File "c:\python\lib\site-packages\matplotlib\backends\backend_webagg.py", line 29, in <module>
import tornado
ModuleNotFoundError: No module named 'tornado'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 12, in <module>
File "c:\python\lib\site-packages\matplotlib\backends\backend_webagg.py", line 31, in <module>
raise RuntimeError("The WebAgg backend requires Tornado.")
Error on running the generated exe:
File "c:\python\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module
exec(bytecode, module.__dict__)
File "site-packages\scipy\sparse\linalg\isolve\iterative.py", line 7, in <module>
File "c:\python\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 714, in load_module
module = loader.load_module(fullname)
ImportError: DLL load failed: The specified module could not be found.
[22724] Failed to execute script main
I have tried the suggested solutions on git links but nothing seems to work. The script itself runs fine. Iam on Windows 10, Python 3.6
I was able to finally resolve the issue by following:
Installing and install tornado and importing tornado as pointed by
Diego Contreras in comments
Following the steps mentioned in the post [How do you resolve 'hidden imports not found!' warnings in pyinstaller for scipy?
Make sure your Microsoft build tools are installed and the dll location is present in PATH(both x86 and x64). Restart the machine after editing PATH variables.