how to install and activate libraries numpy - python

I used'pip install numpy', it looks like it was installed (if try to install again - Requirement already satisfied: numpy in c:\users\pk\appdata\local\programs\python\python38-32\lib\site-packages (1.19.4)) but when I've tried to use 'import numpy', ModuleNotFoundError: No module named 'numpy' appears
Is there any way to solve it?

try to install all with pip3 install numpy etc...
check if you use python 2.x or 3.x from your IDE

Related

Can't install python libraries

got a new laptop (MacBook Air with Catalina) and installed python 3 thru Homebrew.
When trying to install and run some libraries in a jupyter notebook (also installed thru Homebrew) like:
!pip3 install pandas
and then:
import pandas as pd
I get the error:
ModuleNotFoundError: No module named 'pandas'
Same thing with numpy, matplotlib, bs4, etc. Even though when I rerun the !pip3 install something I get the message:
Requirement already satisfied: numpy in /usr/local/lib/python3.8/site-packages (1.19.2)
When I run:
!which python3
!which pip3
I get
/usr/local/bin/python3
/usr/local/bin/pip3
is there something I'm doing wrong?
I’ve catch like this problem
It helped me that:
Uninstall python
And install python
Then reboot system
I guess your Catalina use 3 version py3 this time
It’s need realias
I guess on Mac OS is better to use pip3 by terminal.
Problem seemed to be installing jupyter thru homebrew. Uninstalled it, and then reinstalled it with pip and now everything is working

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

Numpy: import error for python2.7 after get-apt upgrade

Today, I have decided to upgrade my software packages:
sudo apt-get upgrade
After that, I am trying to launch my python2 code and the error appears:
ImportError: No module named numpy
I have tried pip install numpy, but got a message
Requirement already satisfied: numpy in /home/user/anaconda3/lib/python3.5/site-packages (1.15.1)
pip2 install numpy produces an exception:
pkg_resources.VersionConflict: (pip 18.0 (/usr/local/lib/python3.5/dist-packages), Requirement.parse('pip==8.1.1'))
conda install numpy results in
# All requested packages already installed.
which python gives me
/home/user/anaconda3/bin/python
which pip results in
/home/user/anaconda3/bin/pip
What could be the problem? Seems like numpy cannot be installed for python2 because it is already installed for python3. I suppose, something went wrong with python2 vs python3 linkage in conda? Is it a problem with python, numpy, pip, conda or environments?

Do I have to install numpy, spicy again for python3?

I have brew install python2 for OsX, then I install numpy, scipy using pip install.
I also need python3, so I brew install python3, but when I import numpy under python3, import error occurs.
I known I can fix this by install numpy using pip3 install numpy, but do I have to do this? Since I have the package already installed for python2, can I just tell python3 where it is and then use it?
Yes you need to install them using pip3 as well as python3.4 bundles pip in along side of python

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