Reputation: 399
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.
Upvotes: 1
Views: 1574
Reputation: 56
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
Upvotes: 1
Reputation: 2471
source your virtual environment and try to install numpy without sudo via pip from that env. It should work.
Upvotes: 0