0

when I run import numypy in python 3 , the following appears : ModuleNotFoundError: No module named 'numpy'

So you might say try pip3 install numpy But it is already installed which is confirmed when I run pip3 install numpy it shows:

Requirement already satisfied: numpy in /home/shreyash/.local/lib/python3.5/site-packages (1.14.3)

I did try python3 -m pip install numpy but it says : No module named pip

additinal info: i use pip version 10.0.1 check the terminal screenshot :-(

related question : Can't uninstall Python 3.6

I'm unable to make my code run in neither of python2.7 , python3.5 , python 3.6.
numpy works fine with version 2.7 but then it encounters the same problem for using matplotlib. I'm fine with whatever python version so long as I'm able to run my code. I would prefer version 3.x though.

  • 1
    Your extra 3.6 installation will have a different module folder than the built-in 3.5 version. You should be able to invoke the correct pip version using PYTHON -m pip install numpy, replacing PYTHON with the command for your interpreter, e.g. python3. – Byte Commander May 13 '18 at 19:40
  • what is numpy-stl available in apt? would that fix it? – Joshua Besneatte May 13 '18 at 19:42
  • @Byte Commander I did try that but it says : No module named pip – goalpost May 13 '18 at 19:48
  • @ByteCommander My goal is to get started in ML. So I'm assuming I'll need pytorch(my instructor said we''ll be working mostly with pytorch not with tensorflow),matplotlib, pandas, scipy, numpy etc. Which is why I was trying to install them. But seems that I have some problem running them. Is it okay if I uninstall python 3.6 now ? and use the default 3.5 version instead. What do you suggest? I apologise for the digression. – goalpost May 13 '18 at 21:39
  • 1
    You could surely remove your extra 3.6 Python installation, but make sure you do not accidentally remove the system's Python 3.5 - that would give you huge trouble. – Byte Commander May 13 '18 at 21:59
  • @ByteCommander Now I'm unable to uninstall python 3.6 . I ran sudo apt-get remove python3.6 and it says : E: Unable to locate package python3.6 E: Couldn't find any package by glob 'python3.6' E: Couldn't find any package by regex 'python3.6' – goalpost May 14 '18 at 08:01
  • 1
    How did you even install 3.6 in the first place? If it wasn't installed with apt, it can't be removed that way either. – Byte Commander May 14 '18 at 08:34
  • Related question by the same asker: https://askubuntu.com/q/1035996/250300 – Melebius May 14 '18 at 08:38
  • @ByteCommander I don't remember I might have used information from various sources. – goalpost May 14 '18 at 08:43

0 Answers0