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.
Related
When I try to import the mediapipe module which I successfully installed using "pip install mediapipe" I'm getting this error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\user_name\Anaconda3\envs\env_name\lib\site-packages\mediapipe\__init__.py", line 16, in <module>
from mediapipe.python import *
File "C:\Users\user_name\Anaconda3\envs\env_name\lib\site-packages\mediapipe\python\__init__.py", line 17, in <module>
from mediapipe.python._framework_bindings import resource_util
ImportError: DLL load failed: The specified module could not be found.
I am using the anaconda terminal and jupyter notebook to run the codes and my OS is Windows 10. I have tried multiple solutions I found online but none of them worked for me. Any help will be greatly appreciated. Thank you!
There you type in your terminal pip install msvc-runtime to avoid the error.
Than it will work fine. If you want to know more about mediapipe visit:
https://google.github.io/mediapipe/
Thanks.
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>
I'm simply trying to run a .py file, and not sure why it can't find the torch module. I am pretty sure all modules are up to date, and I can see the torch module in my lib/ folder...
Traceback (most recent call last):
File "ptb-lm.py", line 86, in <module>
import torch
File "C:\Users\Public\Anaconda3\lib\site-packages\torch\__init__.py", line 80, in <module>
from torch._C import *
ImportError: DLL load failed: The specified module could not be found.
To be honest I'm still confused as to when / why use conda or pip but I did check that both were up to date!
Try using anaconda to install torch.
Use this link to download https://pytorch.org/get-started/locally/
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.
I have tried all the import methods and upgrading the libraries but still I'm unable to get over this error. I have downloaded and installed all the nltk and corpus data programmatically and it is working in the python shell but i'm getting error.
Traceback (most recent call last):
File "spark.py", line 7, in <module>
from textblob_aptagger import PerceptronTagger
File "/usr/local/lib/python2.7/dist-packages/textblob_aptagger/__init__.py", line 8, in <module>
from textblob_aptagger.taggers import PerceptronTagger
File "/usr/local/lib/python2.7/dist-packages/textblob_aptagger/taggers.py", line 10, in <module>
from textblob.packages import nltk
ImportError: No module named packages
Here's a pastebin to my code and imports..
Same error has been posted on github here. Use this instead to install textblob:
$ pip install -U git+https://github.com/sloria/textblob-aptagger.git#dev
Also, you should change from text.blob import TextBlob as tbto from textblob...
Works for me..