Importing packages/modules

Hi all,

I try to import a module in PyCharm.
The module is in an separate folder (package) with subfolders...

Maybe this is a simple question for many programmers here, but how do I import the module into my project in order to use a Class, defined in the module.

To be a bit more specific:

(1) I have a package 'pythonds' which is a folder with several subfolders containing modules

(2) The path to pythonds is:
        E:\Tutorials\Python Tutorials\Bioinformatics_Algorithms/pythonds

(3) Among several subfolders there is the folder 'graphs' which contains the module ''

        E:\Tutorials\Python Tutorials\Bioinformatics_Algorithms\pythonds\graphs\

(4) The module contains a class I would like to import:

        I would like to import the class 'Graph' which is defined in the module

Thank you very much in advance,

1 comment
Comment actions Permalink
Hi Werner. Sorry, just seeing this one. Your intermediate folders (pythonds, graphs) need a file named to make them into "packages".

Please sign in to leave a comment.