Modulenotfounderror trying to use Behave, Selenium and Python

Asked

Viewed 33 times

2

Rewriting the code from a previous exercise, this time using Behave. Problem is I can’t even begin because I can’t import with the necessary functions.

My directories are these:

-Curso_de_Selenium
    -todo_project
        -features
            -steps
                __init__.py
                todo.py
            __init__.py
            environment.py
            todo.feature
        -page_object
            __init__.py
            page_objects.py
        -pages
            __init__.py
            elements.py
            pages.py
        __init__.py
        behave.ini

All the init.py, in fact, are only there because I read somewhere that they are necessary for Python to interpret the directory as a module but, so far, they have not helped at all. But maybe it’s because they’re blank...

I’ve tried to:

from Curso_de_Selenium.todo_project.pages.pages import pages
from todo_project.pages.pages import pages
from todo_project.pages import pages

But all return the same error: Modulenotfounderror: No module named 'xxxxx'

I tried that too:

from C:.Users.lbsme.Desktop.Curso_de_Selenium.todo_project.pages.pages import pages

But these 2 points in C: return a syntax error.

I saw a lot of people going through this situation but everyone was using pytest so their solutions didn’t suit me. I don’t know what else to try.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.