Installing python-cv from - python

I am following the installation process stated here. I am stuck on step 7; I get an ImportError stating:
"RuntimeError: module compiled against API version 9 but this version of numpy is 7
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
import cv2
ImportError: numpy.core.multiarray failed to import"
In the instructions it recommends me to install the latest version of opencv, so as trial and error i tried an earlier model to see what would happen...i get the same thing -_-.
Could anyone point to me what I'm doing wrong, if there are no feasible solutions, is there a more stable process of doing this
Thanks in advance.

Someone experienced a similar error here. Make sure your numpy is up to date and don't forget to change the path to the new bin directory in your environment variable.

Related

Python and pygame error message "image not found"

I've installed python 3.8.7 on my mid 2009 macbook pro,and can't seem to properly install pygame on it. I've gone into terminal and installed it using the command "pip3 install pygame" which seemed to work fine, but when I try to import it in python it comes up with the error message "image not found". If anyone could help it would be greatly appreciated.
Error stack trace
Traceback (most recent call last): File "/Users/user/Documents/check.py",
line 1, in <module> import pygame File
"/Users/user/Library/Python/3.8/lib/python/site-packages/pygame/__init__.py",
line 81, in <module> from pygame.base import * # pylint: disable=wildcard-
import; lgtm[py/polluting-import] ImportError:
dlopen(/Users/user/Library/Python/3.8/lib/python/site-
packages/pygame/base.cpython-38-darwin.soLibrary not loaded:
/System/Library/Frameworks/Metal.framework/Versions/A/Metal Referenced from:
/Users/user/Library/Python/3.8/lib/python/site-packages/pygame/base.cpython-
38-darwin.so Reason: image not found
as user "ModoUnreal" said in that post
(Error while import pygame)
"A. Check if you have a 64 or 32 bit version pygame and make sure your version of python is the same.
B. Use something like pip install or any other type of method to install pygame.
C. Install a previous version of pygame and python, you might have some more luck with that.
The error is basically saying that a class in pygame called image could not be found. Obviously pygame has not been installed properly so I would suggest using the above methods to install it again.
I hope this helps!"

ModuleNotFound error even pip is already used

I am a new at Python and I have a roblem with installing one framework.
https://github.com/zalando/connexion
I have already used the command in the terminal 'pip install connexion'
But still when I try to start a programm I get such error:
PS C:\Users\fele\OneDrive\Desktop\Python\Uebergabe\pYTHON_BACKEND_2020_03_12> & "C:/Program Files (x86)/Python37-32/python.exe" "c:/Users/fele/OneDrive/Desktop/Python/Uebergabe/pYTHON_BACKEND_2020_03_12/test_local/test_local_application_hook.py"
Traceback (most recent call last):
File "c:/Users/fele/OneDrive/Desktop/Python/Uebergabe/pYTHON_BACKEND_2020_03_12/test_local/test_local_application_hook.py", line 9, in <module>
from cwsm import connexion_manager
ModuleNotFoundError: No module named 'cwsm'
Cannot anybody give me a suggestion why is it happening?
Thanks in advance
The github page shows:
import connexion
So your import is wrong, try using connexion.
Source:
https://github.com/zalando/connexion#running-it

Error from sklearn.neural_network import MLPRegressor

I am building a Neural Network Code on Python. When I executed the code on my laptop, everything was smooth. When I sent it to my friend: it gave the error shown in the picture. I tried uninstalling python and reinstalling it, unistalling pip, uninstalling sklearn, and then installing them. Nothing worked.
ImportError:DLL load failed.
Can anyone please help ?
The complete error is the following:
RESTART: C:\D-drive\AUB 2019-2020\Fall\CHEN499\Mohamad Ibrahim\499 research\neural networks\example 6\NN1.py
Traceback (most recent call last):
File "C:\D-drive\AUB 2019-2020\Fall\CHEN499\Mohamad Ibrahim\499 research\neural networks\example 6\NN1.py", line 1, in <module>
from sklearn.neural_network import MLPRegressor
File "C:\Users\jz08\AppData\Local\Programs\Python\Python37-32\lib\site-packages\sklearn\__init__.py", line 75, in <module>
from .utils._show_versions import show_versions
File "C:\Users\jz08\AppData\Local\Programs\Python\Python37-32\lib\site-packages\sklearn\utils\_show_versions.py", line 12, in <module>
from ._openmp_helpers import _openmp_parallelism_enabled
ImportError: DLL load failed: The specified module could not be found.
Thank you.
I had the same problem and resolved it only through getting back to one of the previous versions of scikit-learn (0.20.2) Try downgrading sklearn.
I'm aware that this is a sub-optimal solution, but hopefully, you'll be able to advance in whatever project you are currently working one. Hope this helps !

ImportError using pyside

I need to use QT and pyside for a school project so hope to install pyside on my computer.
I struggled a little bit to install pyside and I eventually got pyside 1.2.4 installed using pip on both python 2.7 and 3.4.
However when I tried to use pyside-uic or import PySide.QtCore I got this error message:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: dlopen(/Library/Python/2.7/site-packages/PySide/QtCore.so, 2): Library not loaded: #rpath/libpyside-python2.7.1.2.dylib
Referenced from: /Library/Python/2.7/site-packages/PySide/QtCore.so
Reason: image not found
I have been working on this for hours and tried to reinstall with macport.
I also tried to link QtCore.framework from other directory using:
ln -vis /usr/local/Cellar/qt/4.8.7_2/lib/QtCore.Framework /Library/Python/2.7/site-packages/PySide/QtCore.Framwork
nothing worked out and I'm still getting the same error.
Please help and thank you guys so much.
Did you try to set DYLD_LIBRARY_PATH ?
export DYLD_LIBRARY_PATH=/Users/you/virtualenv/lib/python2.7/site-packages/PySide
See here : https://github.com/PySide/PySide/issues/129

RaspberryPi OpenCV ImportError undefined symbol

I installed opencv-2.4.9 on my raspberry pi.When i try to run facedetect.py sample file,i am getting that error:
Traceback (most recent call last):
File "facedetect.py", line 10,in <module>
import cv2.cv as cv
ImportError: /usr/lib/arm-linux-gnueabihf/libQtGui.so.4: undefined symbol:
How can i solve this ? I am getting the same error when compiling cpp or any other example file. Qt's version is 4.
It looks like you're either missing a shared library, or there's a version mismatch between the versions of OpenCV and Qt installed.
You'll need to check what the missing/undefined symbol is, which version of libQtGui.so provides it and then check if you have the correct version installed.

Categories

Resources