I just moved from windows 8 to Ubuntu 15.04. I do some programming in python3, and some programs rely on imports from self made modules. In windows all I had to do was add the directory which contains all my programs to the PATH environment variable and it would work. I have tried to google how to do this in Ubuntu, but the talk of .bashrc, .profile and scripting languages are beyond me currently. In a basic step by step way, can someone explain how to get these imports working please?


The very simple way to do it is like the following:

export PYTHONPATH="/your/module/path"

from the terminal. But you have to do this every time you start the terminal.

If you want this to be permanet, you just have to open .bashrc and addit at the end of the file.

You can check the existing paths by printing sys.path

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.