ModuleNotFoundError: No module named 'numpy.testing._private - python

I'm trying to run tensorflow:
it turned out
from numpy.testing._private.pytesttester import PytestTester
ModuleNotFoundError: No module named 'numpy.testing._private'
numpy/init.py look like this:

I had the same problem when I installed tensorflow. Solved the issue by upgrading pip :
python.exe -m pip install --upgrade pip
and installing numpy again :
pip uninstall numpy
pip install numpy

Related

Module not found even though I have it installed

I've tried all of this
pip install numpy
pip3 install numpy
python -m pip install numpy
and when I try import numpy i just get
ModuleNotFoundError: No module named 'numpy'
how do i fix this?

ModuleNotFoundError: No module named 'tensorflow_quantum'

I'm using Python 3.8(64-bit)
Basically, I tried every possible solution on the internet like update the python version and tensorflow version etc.
But when I try to do this:
import tensorflow_quantum as tfq
terminal always say:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'tensorflow_quantum'
Does anyone have any idea on this issue? Cheers
Please run the following:
pip3 install --upgrade pip
pip3 install tensorflow==2.3.1
pip3 install -U tensorflow-quantum
I have faced quite a similar problem and I followed this link for some help
in short I created a virtual environment with
python version == 3.6.2
conda create -n your_new_env_name python=3.6.2 anaconda
and then activated this environment as follows before you continue
conda activate your_new_env_name
then installed tensorflow
pip install tensorflow==2.1.0
pip install tensorflow-gpu=2.0.0
pip install tensorflow-quantum
you may face 2 errors which you might need to be solved
the first is this
When importing tensorflow, I get the following error:
No module named 'numpy.core._multiarray_umath'
all you have to do is this
pip install numpy --upgrade
or if needed
pip install numpy --upgrade --user
you may also get an error when import tensorflow-quantum that's related to google.api_core and what solved the problem for me was to do the following
pip install google.api_core==1.16.0
you may also need to the following
pip install cython
I hope it works!

can't install edward2 a library in python

I want to install edward2 library: https://github.com/google/edward2.
I used this command: pip install "git+https://github.com/google/edward2.git#egg=edward2". But when I want to import it in spyder it had an error:
ModuleNotFoundError: No module named 'edward2'.
Could someone help me to install it with conda?

No module named 'numpy' Even When Installed

I'm using windows with Python 3.7.3, I installed NumPy via command prompt with "pip install NumPy", and it installed NumPy 1.16.4 perfectly. However, when I run "import numpy as np" in a program, it says "ModuleNotFoundError: No module named 'numpy'"
I only have one version of python installed, and I don't know how I can fix this. How do I fix this?
python3 is not supported under NumPy 1.16.4. Try to install a more recent version of NumPy:
pip uninstall numpy
pip install numpy

Cannot import numpy with python3.5, but can import with python2.7

I can use numpy with built in python. But with python3.5 interpreter, it says
ImportError: No module named 'numpy'
but when I type $ sudo pip3 install numpy it says
"Requirement already satisfied: numpy in /root/.local/lib/python3.6/site-packages"
What should I do?
I had the similar problems before. When you run pip3, it actually linked to pip in your python3.6. Packages for different python distributions are in different folders. python3.5 -m pip install numpy should solve the problem.
Install module to python3.5 with pip3.5 install numpy or user python3.6 interpreter.

Categories