Thanks to George I slowly got to the answer. The root of the problem lies in that I installed my Python 3.5.2 version from a source rather than from the Ubuntu aptitude package manager.
Basically, if Python is installed from a source, then, to look for 3rd party packages, it uses
/usr/local/lib/python3.5/site-packages, but if it was installed using
apt, then Python looks in
/usr/local/lib/python3.5/dist-packages. This is to make sure that the several Python versions don't get tangled up. Here is another question that explains: what is the difference between dist-packages and site-packages?.
My Python3 installation was looking into site-packages and ignoring dist-packages, so I added a path file to make it look inside dist-packages as well.
sudo vim dist-packages.pth
(Press i to go into insert mode inside Vim)
:x (and Press Enter/Return)
Now when Python looks inside
/site-packages, it finds
dist-packages.pth which makes it go into
Someone else had a problem exactly the reverse of mine, where their Python installation only looked inside
/dist-packages, so they used the exact same method as above except instead of making a
dist-packages.pth file (containing
/site-packages, they made a
site-packages.pth file (containing
Check if it worked:
The easy way to check if this worked is to go into your Python interpreter and print sys.path. It should now contain both package paths:
Python 3.5.2 (default, Nov 19 2016, 02:36:25)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys; print(sys.path)
['', '/usr/local/lib/python35.zip', '/usr/local/lib/python3.5', '/usr/local/lib/python3.5/plat-linux', '/usr/local/lib/python3.5/lib-dynload',
I hope this helps someone one day...