1

I try to import nuurolab using this code:

import neurolab as nl

But it gives this error :

ModuleNotFoundError: No module named 'neurolab'

Then I try to install neurolab using

sudo pip3 install neurolab

Then this message shows :

Requirement already satisfied: neurolab in /usr/local/lib/python3.5/dist-packages

How to solve this problem?

Gihan Chathuranga
  • 442
  • 10
  • 16

1 Answers1

0

You are installing the module in the wrong place. By default on Linux there are 2 integrated versions, 2.7 and 3.5 plus the one you installed. It is important not to confuse between them when installing modules or it will end up in the wrong version.

When typed in the terminal:

python brings up 2.7 python3 brings up 3.5

and for python 3.6 it will be python3.6.

pip does this as well.

pip will be for 2.7 pip3 for 3.5

and

pip3.6 for 3.6

So when installing you just have to change which environment you install it in:

sudo python3.6 -m pip install neurolab

If you get an error saying pip3.6 cannot be found, in some cases it may be pip36 otherwise you need to install pip for 3.6 using:

sudo apt install python3.6-pip
Xantium
  • 11,201
  • 10
  • 62
  • 89
  • @GihanChathuranga How do you access your python 3.6 in terminal? – Xantium Feb 03 '18 at 19:28
  • This error occurs when trying to install python3.6-pip Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package python3.6-pip E: Couldn't find any package by glob 'python3.6-pip' E: Couldn't find any package by regex 'python3.6-pip' – Gihan Chathuranga Feb 03 '18 at 19:34
  • @GihanChathuranga Did you try `sudo python3.6 -m pip install neurolab` first? You may already have it. Either way I need to know how you start python 3.6 in your terminal because that will be pretty much the same as pip. – Xantium Feb 03 '18 at 19:36