1

I have an Amazon EC2 instance running Amazon Linux and a virtual environment with python 3.6.

I can't seem to install Numpy :

(testenv) [ec2-user@ip-xxx-xx-xx-xx venv]$ pip3 install numpy
Collecting numpy
  Using cached numpy-1.13.3-cp36-cp36m-manylinux1_x86_64.whl
Installing collected packages: numpy
Successfully installed numpy-1.13.3

(testenv) [ec2-user@ip-xxx-xx-xx-xx venv]$ python
Python 3.6.2 (default, Nov  2 2017, 19:34:31) 
[GCC 4.8.5 20150623 (Red Hat 4.8.5-11)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'numpy'

I also did a sudo python36 -m pip install numpy it did not work.

2
  • How about sudo python -m pip install numpy? What you posted should make your python36 executable work, but it's not clear to me that python refers to the same one. Commented Dec 10, 2017 at 20:54
  • I get Requirement already satisfied: numpy in /usr/local/lib64/python2.7/site-packages It's installed for previous version of Python but not for 3.6 which is the one I use on this virtual environment... Commented Dec 11, 2017 at 8:37

3 Answers 3

1

I got same problem and found a solution that worked for me on that website : https://samsblogofthings.wordpress.com/2016/07/17/installing-numpy-on-your-amazon-ec2-instance-for-a-particular-python-version/

Basically do :

alias sudo='sudo env PATH=$PATH'

and then : sudo pip3 install numpy

Sign up to request clarification or add additional context in comments.

1 Comment

This pip3 in place of the pip I was using (to install scipy-- very analogous to numpy) did the wonder for me ! Thanks.
0

Run in terminal

sudo yum install numpy

5 Comments

I'm running Amazon Linux, and doing sudo yum install python3-numpy results in No package python3-numpy available.
Try sudo yum install numpy or sudo yum install python-numpy
Doing sudo yum install numpy installed numpy for Python 2.7. But in my virtual environment with Python 3.6 it still not shows.
sudo yum install python3-numpy
I tried as well, got a No package python3-numpy available.
0

source your virtual environment and try to install numpy without sudo via pip from that env. It should work.

1 Comment

That's what I did, you can see on my post the (testenv) meaning I had sourced it already.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.