1

I have tried to install python 3.7 on my ubuntu 16.04 via this link. It is Installing it without any error and it returns :

which python3.7
/usr/local/bin/python3.7

Also I have other python versions (3.5 and 2.7), when I run :

which python
/usr/bin/python

but I can not import numpy in 3.7 :

python3.7
Python 3.7.2 (default, Feb 19 2019, 13:25:43)
[GCC 5.4.0 20160609] 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 have tried to install numpy :

python-numpy is already installed at the requested version (1:1.11.0-1ubuntu1)

Furthermore, I don't have this issue in 3.5 :

python3.5
Python 3.5.2 (default, Nov 12 2018, 13:43:14)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
>>>

Can someone tell me what is wrong here ?!!! and how could I fix this?

0

1 Answer 1

2

Python 3.7 installed from source in Ubuntu 16.04 cannot make use of the numpy version from the Ubuntu package system.

You should be able to install it via pip3.7:

pip3.7 install numpy

See also this answer on ServerFault.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .