0

I am having below folder structure (find image) but when I use below code and run using command "behave -D BROWSER=chrome --no-capture " it gives me error like ModuleNotFoundError: No module named 'product_library' Not able to understand product_library is available in same path but still compiler throwing error.

My usage is like

from product_library.initialize import Initialize


def before_all(context):
    print(".............Executing before all.............\n")


def before_feature(context, feature):
    print(".............Executing before all.............\n")

PROJECT STRUCTURE

sushil
  • 301
  • 4
  • 16
  • Add `import os; print(os.path.abspath("."))` before your failing import to check if that's really the folder where `product_library` is inside. – Jeronimo May 24 '18 at 11:49
  • @Jeronimo no it's not inside it's outside. If you look at the [link](https://i.stack.imgur.com/FQR4w.png) image. The structure which has (feture_test, foundation, product_lib) directories. what should I do so that it can access module outside. – sushil May 24 '18 at 12:13
  • I've never seen a directory structure like yours work with behave before. According to the documentation, your directory structure for behave _should_ look like [this](http://behave.readthedocs.io/en/latest/gherkin.html#feature-testing-layout). – natn2323 May 25 '18 at 15:58

0 Answers0