importing eyed3

(Linux)
I just installed eyed3 for python using apt-get, everything installed fine but when I tried to import eyed3 I got a trackback error, no such module. Do I need to do something special to let python know where the module is at or do I need to move the module manually. Oh, I tried this with python 2.7 and 3 and I got the same result.

On the same topic, if I write my own module how can I set it up to be imported as if it was a built in module rather than having to have a copy in every project directory?

in a terminal, then add the following lines to the file ~/.bashrc, and restart the terminal

PYTHONPATH="$HOME/pymods:$PYTHONPATH"
export PYTHONPATH

Now every python file added to the directory ~/pymods becomes importable
from anywhere (under your user name). For example create a file~/pymods/abracadabra.py and use import abracadabra from anywhere.
You can also store python packages in pymods (directories containing a file __init__.py)
You can also add symbolic links to python files and packages.

There are other techniques for this, but it should be a starting point.

A directory in the PYTHONPASS that already has a __init__.py file is a package directory. Many of these directories appear in the site_packages directory. Putting your own modules in there would be possible, but could lead to name collisions. Also, if you pass your program on to other folks, they would not know which module was written by you. Could get very messy!

This might help ...

# show the system path for Python --> PYTHONPATH
import sys
for path in sys.path:
print(path)

An alternative to what I wrote above is to create a per user site-packages directory (pep 370). In my kubuntu system it means typing

$ mkdir --parents ~/.local/lib/python2.7/site-packages

in a terminal. This directory is then automatically added to the python path when I run python. I can add my own scripts to the directory. For example if I have a file ~/Documents/daniweb/bargr.py, I can add a symbolic link