python - ImportError: No module named numpy on Ubuntu after Numpy Installation -


i trying use numpy on ubuntu 16.04. have python 2.7.12 installed. have tried:

sudo apt install python-numpy  sudo apt autoremove   dpkg -l python-numpy 

here excerpt of output:

/. /usr /usr/lib /usr/lib/python2.7 /usr/lib/python2.7/dist-packages /usr/lib/python2.7/dist-packages/numpy-1.11.0.egg-info /usr/lib/python2.7/dist-packages/numpy-1.11.0.egg-info/dependency_links.txt /usr/lib/python2.7/dist-packages/numpy-1.11.0.egg-info/pkg-info /usr/lib/python2.7/dist-packages/numpy-1.11.0.egg-info/top_level.txt /usr/lib/python2.7/dist-packages/numpy /usr/lib/python2.7/dist-packages/numpy/lib /usr/lib/python2.7/dist-packages/numpy/lib/shape_base.py 

however, when try run simple file such this, still same error.

#!/usr/bin/env python2  import numpy np  = np.array([1, 2, 3])  python test2.py  traceback (most recent call last):   file "test2.py", line 3, in <module>     import numpy np importerror: no module named numpy 

is there left need check for? thanks!

try command line,

pip install numpy 

then should able import numpy in new python session.

but handle sorta thing well, should create sandboxed environments projects specify not packages , python versions. way don't accidentally install package in wrong path, or have installed python2 not have available if default python python3, sorta thing.

if download anaconda, great way manage that: https://conda.io/docs/using/envs.html


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -