How to solve no module found Numpy error? - python

I'm getting this error message when loading Keras Original error was: No module named 'numpy.core._multiarray_umath'. I'm seen a number of other posts on here trying to solve this issue, but what has worked for them in the past is not working for me.
I've uninstalled and reinstalled Python, Anaconda, and Numpy but still nothing.
Numpy is version 1.16.2
Anaconda3 is versin 3.7.3 64 bit
Does anyone have suggestions how to get around this? My computer did a system update yesterday and since then many things have been broken. I thought doing fresh installs of Anaconda would solve this but it hasn't

This seems to be a bug on numpy version 1.16, as a work around, you can install numpy 1.15.
pip uninstall numpy
pip install 'numpy=1.15'

Related

"stereoscope" package installation in Python

I have installed the package "stereoscope" successfully a few days ago and have been using it to do analysis. However, when I am trying to use it today I got the error that the command "stereoscope" is not found. I suspect that this error usually comes up when the package is not installed. It is weird I know. Therefore, I tried to install it again. However, I found the problem "numpy 1.21.1 is installed but numpy<1.21,>=1.17 is required by {'numba'}". What I understand from this error is that I need to install the NumPy version less than 1.21.1 or greater than or equal to 1.17. So, I tried to install the required version such as NumPy 1.20.3. The issue remains the same. I do not know why it is still saying my numpy version is 1.21.1 even after I uninstalled this version. Please help me with how to resolve this issue?
This is the link where I follow to do the installation stereoscope installation
I tried to update the numba and use the command "pip list" to get numba version is 0.53.1 and the numpy version is 1.21.1. But still do not resolve the error. I have uninstalled the numpy version 1.21.1 and change it to numpy version 1.20.3 but the error remains.
I have resolved this issue by uninstalled all version of numpy that present on my system. I then create a new virtual environment. I start install the package stereoscope including all required packages on this virtual environment. This way there will be no crush between these installation and my computer system.

How to remove hidden utdated scipy file so it won't import with python in VS Code OSX

I am currently trying to run a program with Scipy, and I want to use the load_npz module.
Whenever I tried to run it, the compiler would say that that module doesn't exist.
I ran scipy.__version__ and got 0.13.0b1, which makes sense as to why it couldn't find the module as it doesn't exist in that version, but I am confused as I have 1.5.2 installed in both pip and brew yet it keeps defaulting to the oldest version which is very frustrating.
Does anybody know how to get rid of this version? I have tried uninstalling from pip and brew, along with finding the path of the imported scipy with the outdated version yet it still is causing issues.
I do have a lot of packages installed (numpy, matplotlib, etc.) so could it be a dependency that keeps reinstalling an old version?
Strangely, even if I delete scipy from both brew and pip, it will still show the old version but throw an error on a different local file that also uses scipy saying the module does not exist (which is expected as I deleted it).
write this python to find out the location of the imported scipy
import scipy
print(scipy.__file__)
I figured it out, I just deleted all my possible scipy locations and then just downloaded Anaconda and I'm using that as my python interpreter.

Numpy.dtype has wrong size PyOpenGL

This seems to be an internal problem with my installation of PyOpenGL. I recently installed PyOpenGL 3.1.0 and numpy 1.8.1 on my system (I am currently using Ubuntu 16.10) for Python 2.7, but my testing immediately because for the program I want to write, the specific import I need is OpenGL_accelerate.numpy_formathandler, however, when I import this package, I get the error: ValueError: numpy.dtype has wrong size, try recompiling. I took this to mean either my numpy version was wrong, or I just needed to re-install one or both of the packages. I tried upgrading numpy to it's most recent release, to no avail. Then I tried uninstalling and re-installing both packages, PyOpenGL at version 3.1.0 each time, and numpy both at versions 1.8.1 and the most recent version. I am at a complete loss at what to do here. If anyone has had this issue or a very similar one, please help! I have already looked around at other questions for an answer and none of them have seemed to help so far.

Importing Numpy results in error even though Anaconda says it's installed?

I signed up for a statistics udemy course which uses jupyter running the stock numpy package out of anaconda.
Numpy is working when I run python 3.4.4 in pycharm, but it will not work in either anaconda2 nor anaconda3.. this makes no sense because numpy comes stock as part of the anaconda library.
When I try importing numpy in jupyter, running a local instance of a python 2 script, I get this:
Thinking I could sidestep the error using a IDE, I tried pycharm and I got this:
Numpy is part of the anaconda default library which I'm running, so I checked and made sure the numpy package was there via the Anaconda Prompt using 'conda list'...
Why won't it import successfully?
Before I uninstall and reinstall everything, does anyone have any ideas?
Yayyyy. I figured it out. So I had several different python versions before I was running python through anaconda/jupyter. As a result, the tethering in-between the additional package libraries to the version of python running was shifty. For example, I may have had numpy working configured to 3.4 but not 2.7..
anyways, to break down the steps I took, I uninstalled all instances of python (both anaconda and normal versions). Then I deleted the old 3.4 libraries from my C drive. Then I installed anaconda 2.7.11 again, tested importing numpy and got the same error. Then I thought to myself, what if the packages are installed separate from the python library and their configuration didn't get reset via the reinstall.. so via the anaconda prompt I typed:
pip uninstall numpy
which removed the package I was having trouble with. and then :
pip install numpy
which downloaded and reset a whole new instance of the package. Then I tested importing numpy in both the anaconda prompt and jupyter = both worked.
I'm very happy that this ended up working out as I can continue on as planned. For anyone else who experiences a similar problem, I would try uninstalling, then reinstalling the problem causing package via pip commands - this step seemed to have the most impact on fixing the problem. Then if that doesn't work proceed to uninstall and reinstall the environments in intervals.
You can try using the following command:
pip install numpy --upgrade
This will uninstall old installed version of numpy and install a new version. This command solved my issue.
try activating you base conda environment before starting jupyter.
>activate root
>jupyter notebook

Reinstalling numpy under ubuntu

Somehow I managed to break a working numpy library (I tried to install some optimization libraries).
If I run import numpy in ipython then I get ImportError: libblas.so.3gf: wrong ELF class: ELFCLASS32.
Reinstallation of numpy does not help (using sudo-apt get remove/install).
I see that the problem is libblas is 32bit version. I did not find 64 version in synaptic package manager.
Another confusing part is, ipython says that error is in
`/home/andrey/.local/lib/python2.7/site-packages/numpy/linalg/linalg.py`
but when I delete numpy, this folder still exists.
Do you know how can I fix it?
~/.local/lib/python2.7 is the per-user installation directory, of course you cannot uninstall numpy from there using apt-get. As numpy there is apparently 64bit, it requires 64bit libs so you need to install 64bit libblas on your system.

Categories

Resources