[Python-Dev] Problem in importing python packages under python 3.6 environment

Oleg Broytman phd at phdru.name
Thu Aug 9 12:21:11 EDT 2018


Hello.

   This mailing list is to work on developing Python (adding new
features to Python itself and fixing bugs); if you're having problems
learning, understanding or using Python, please find another forum.
Probably python-list/comp.lang.python mailing list/news group is the
best place; there are Python developers who participate in it; you may
get a faster, and probably more complete, answer there. See
https://www.python.org/community/ for other lists/news groups/fora. Thank
you for understanding.

On Thu, Aug 09, 2018 at 06:15:49PM +0530, "Poornima .D." <poornimad2811 at gmail.com> wrote:
> Hi All,
> 
> 
> I have limited knowledge on python development.  I am trying to write a
> test application which needs to import from many packages across
> mutliple directories.
> 
> 
> I tried using an environment variable and appending to sys.path variable so
> that import Class methods works.
> 
> 
> I am trying to replace the above logic by below syntax.
> 
> 
> from directory.fileName import ClassName
> 
> 
> But this syntax does not work.  Please let me know any solution for this
> issue.

   Not enough information to answer. To ask such a question you'd better
prepare a simple exmaple that doesn't work -- just a few small files and
directories.

   Learn about Python modules/packagaes at
https://docs.python.org/3/tutorial/modules.html especially paying
attention to The Module Search Path:
https://docs.python.org/3/tutorial/modules.html#the-module-search-path

Oleg.
-- 
    Oleg Broytman            https://phdru.name/            phd at phdru.name
           Programmers don't die, they just GOSUB without RETURN.


More information about the Python-Dev mailing list