I'm trying to set all of this up on Windows 7. This is the error I get when I try to import sklearn or scipy. I've installed sklearn and scipy using whl files. I don't remember what I used to install numpy but I can import numpy without trouble.
In my case I couldn't install scipy using pip install scipy, I finally managed to get it installed by using Scipy from here, and installing it as follows:
pip3 install scipy-0.19.0rc2-cp36-cp36m-win_amd64.whl
When I finally had scipy installed, my numpy stopped working and started giving that error. So I decided to install numpy from here:
pip3 install numpy-1.12.0+mkl-cp36-cp36m-win_amd64.whl
Make sure that you install the correct numpy for your architecture and version of Python.
I hope that helps you, cheers.
Related
I am new to python and installed opencv by typing: pip install opencv-contrib-python in the command prompt.
Below I have shown a very simple example of reading in an image and showing it on the screen:
However, I get this error:
When I hover over the imread method in PyCharm, it says Cannot find reference 'imread' in '__init__.py'
It was showing import and runtime errors when I typed import cv2 and import numpy in the command prompt.
I tried going back to the previous version of NumPy by typing pip install --force-reinstall numpy=1.19.3. So, now when I type import cv2 and import numpy in the command prompt, it shows no error but it says it still can't find a reference to it in PyCharm.
I am using Python 3.9.1 with pip 20.2.3.
If you are using python interpreter with anaconda change it to default python one. if you have not installed python separately then install it and assign the path to it.
somewhat this will be the path
c://user/APpData/Local/Programs/Python/python39/python.exe
The NumPy multicore import error is a result of installing NumPy on Windows that is incompatible with the version of OpenCV that you have. Judging from your screenshots as well as the error, you are running Windows. Try installing Christoph Gohlke's NumPy libraries instead that were built with multicore support enabled.
First do:
pip install pipwin
Then:
pipwin install numpy
This should hopefully settle the OpenCV dependency problem you have.
To solve it, you should upgrade numpy installation. Try:
pip install -U numpy
For information here
Instead of doing:
import cv2
try doing:
from cv2 import cv2
This worked for me after a lot of troubleshooting also using pycharm. I now have access to all of the regular cv2 methods.
After having try many times and after searching a lot, I still don't manage to use opencv-python. Actually, import cv2 works for me, but when I want to make this file working, I got this message
Importing the multiarray numpy extension module failed
Do you have an idea of what is going on ?
In Python, OpenCV images are using the same data representation as Numpy arrays. It's quite frequent to use numpy logic on OpenCV images and vice versa.
So first thing to check is that you have numpy installed.
Assuming you have numpy installed, maybe you mixed pip and conda commands to install opencv and numpy ? It's generally something to avoid unless you really know what you are doing.
You can run pip list and conda list to have a quick overview of installed packages.
Using pip only is good enough in most cases, a lot of prebuild python wheels for Windows are available on pip, including opencv-python and numpy.
After cleaning conda installed packages, try to run :
pip install --upgrade --force-reinstall numpy to make a clean numpy install.
when I do:
from sklearn import linear_model
I get the error:
ImportError: cannot import name 'getfullargspec'
Interestingly, this does not happen a few days ago. So I tried to install python and scipy stack again on my computer using Anaconda again but does not solve the problem. What might be wrong with my system?
Thank you in advance.
Install using pip
pip install scipy
And use pip to install the following packages such as numpy, pandas, etc...
If you are using Python 3 then install pip3 and use pip3 install scipy
Check this answer out if problem persists: https://stackoverflow.com/a/27425458/5110035
I've been trying to install sklearn manually using pip with python 3.6 and i'm facing a lot of trouble. I couldn't get it installed cuz there was a problem with scipy.
I installed pycharm and tried to install both of them using the Packages interfaces and i'm still getting an error while trying to install sklearn.
NB: I installed scipy and numpy+mkl using their whl files
The module name is scikit-learn, not sklearn.
I have started working on python, and now, I want to solve real scientific problems for which SciPy is required.
I have tried to install SciPy with:
pip install scipy-0.16.0-cp34-none-win_amd64.whl
and I got message that SciPy is installed successfully. However, when I want to import SciPy the error is:
raise ImportError("Numpy OpenBLAS flavour is needed for this scipy build.")
ImportError: Numpy OpenBLAS flavour is needed for this scipy build.
I am using Windows OS, and I am using Eclipse+PyDev as an IDE. What makes this sort of problem? And how can I solve it?
Have you tried to install NumPy which is an requirement for SciPy?
You can download it here: Python Packages For Windows
Download and install the wheel for numpy with OpenBLAS from https://pypi.anaconda.org/carlkl/simple/numpy/