Can not import cv2 in python 3.6 - python-3.x

>>> import cv2
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: DLL load failed: The specified module could not be found.
>>>
I have copied cv2.pyd file to python36-32/Lib/site-packages
help please!!

Related

'Invalid syntax' error when importing torch (Linux)

I'm trying to install torch under miniconda and simple import torch gives me the following error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/vol/tcm17/username/miniconda3/lib/python3.8/site-packages/torch/__init__.py", line 779, in <module>
from .serialization import save, load
File "/vol/tcm17/username/miniconda3/lib/python3.8/site-packages/torch/serialization.py", line 18, in <module>
from typing_extensions import TypeAlias
File "/home/username/.local/lib/python3.8/site-packages/typing_extensions.py", line 880
if stripped_args
Interestingly, if I repeat import torch again the error message changes:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/vol/tcm17/username/miniconda3/lib/python3.8/site-packages/torch/__init__.py", line 249, in <module>
for name in dir(_C):
NameError: name '_C' is not defined
I'm not using notebooks, python version is 3.8.16, pytorch version is 1.13.1. Miniconda is installed in a local folder (it's a university server so I can only do it like this due to disk space restrictions), the server runs on Ubuntu.
What could possibly be the problem?
The only recommendation I found for similar problems is to install Cython but it didn't help.
Downgraded to python 3.6 and this somehow solved the problem.

Installing Tensorflow on win10 ( installed but showing error while doing import tensorflow as tf)

I am using Windows 10Pro ss of my OS info
Using the latest version of Anaconda, python(version 3.8.3), TensorFlow version information as follows
Name: tensorflow
Version: 2.3.0
I installed Tensorflow CPU.
While importing TensorFlow I have the following errors.
Traceback (most recent call last):
File "C:\Users\Prakash\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 64, in
from tensorflow.python._pywrap_tensorflow_internal import *
ImportError: DLL load failed while importing _pywrap_tensorflow_internal: The specified module could not be found.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\Prakash\Anaconda3\lib\site-packages\tensorflow_init_.py", line 41, in
from tensorflow.python.tools import module_util as module_util
File "C:\Users\Prakash\Anaconda3\lib\site-packages\tensorflow\python_init.py", line 40, in
from tensorflow.python.eager import context
File "C:\Users\Prakash\Anaconda3\lib\site-packages\tensorflow\python\eager\context.py", line 35, in
from tensorflow.python import pywrap_tfe
File "C:\Users\Prakash\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tfe.py", line 28, in
from tensorflow.python import pywrap_tensorflow
File "C:\Users\Prakash\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 83, in
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "C:\Users\Prakash\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 64, in
from tensorflow.python._pywrap_tensorflow_internal import *
ImportError: DLL load failed while importing _pywrap_tensorflow_internal: The specified module could not be found.
Failed to load the native TensorFlow runtime.
Screen shot of the error showning
please help me resolve this issue.
comment if any other information is needed

python3 - ImportError: cannot import name '_imaging'

I am getting the following error:
Traceback (most recent call last):
File "./Logic/model.py", line 12, in <module>
from PIL import Image, ImageFilter
File "/usr/lib/python3/dist-packages/PIL/Image.py", line 66, in <module>
from PIL import _imaging as core
ImportError: cannot import name '_imaging'
I don't have PIL installed but I have pillow installed
what to do?

qgis ModuleNotFoundError: No module named 'PyQt5.pyqtconfig'

Traceback (most recent call last):
File "D:/Study/qgis3/QGIS/cmake/FindPyQt5.py", line 34, in <module>
import PyQt5.pyqtconfig
ModuleNotFoundError: No module named 'PyQt5.pyqtconfig'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "D:/Study/qgis3/QGIS/cmake/FindPyQt5.py", line 37, in <module>
import PyQt5.QtCore
ImportError: DLL load failed:
Found SIP version: 4.19
Traceback (most recent call last):
File "D:/Study/qgis3/QGIS/cmake/FindQsci.py", line 45, in <module>
from PyQt5.Qsci import QSCINTILLA_VERSION_STR
ImportError: DLL load failed:
CMake Error at cmake/PyQtMacros.cmake:22 (MESSAGE):
pyuic[4|5] not found - aborting
Call Stack (most recent call first):
CMakeLists.txt:714 (INCLUDE)
I have installed pyqt5 and SIP though pip3, but above problem still arises.

scipy.stats attribute not found

I tried to import scipy.stats as ss but it keeps showing me an import error:
Traceback (most recent call last):
File "E:\My Python Files\KNN_Classification.py", line 4, in <module>
import scipy.stats
File "D:\Python3.6\lib\site-packages\scipy\stats\__init__.py", line 343, in <module>
from .stats import *
File "D:\Python3.6\lib\site-packages\scipy\stats\stats.py", line 169, in <module>
import scipy.special as special
File "D:\Python3.6\lib\site-packages\scipy\special\__init__.py", line 640, in <module>
from ._ufuncs import *
ImportError: DLL load failed: The specified module could not be found.
What should I do?
Most likely a wrong installation. You should remove the build directory as well as the installed scipy in site-packages, and then reinstall scipy.

Resources