2

I'm new to python and I'm kind of lost here, I have a gherkins project in lettuce but I found i am creating a project using behave.

I created these files and folders:

features
features > steps
features > steps > example.py
features > environment.pys
features > example.feature

Then while I was running it, I found it didn't had the dependencies needed, because I'm getting this error:

ModuleNotFoundError: No module named 'pynput'

So, I looked for a build tool for python and found pybuilder that seems like a good choice, so I created a build.py like this:

from pybuilder.core import init, use_plugin, task
from subprocess import call

use_plugin("python.core")
use_plugin("python.install_dependencies")

default_task = "behave"

@init
def initialize(project):
    project.depends_on("pynput")

@task
def behave(project):
    call(["behave"])

But the problem persists it doesn't pick the dependency on "pynput" and I'm still getting the same error, and I found that other sites use a file requirements.txt for dependencies instead, and I'm not sure if its possible but I would prefer to use the pybuild structure for a project and that's the reason nothing is working, something like this:

src
src > test 
src > test > python
src > test > python > example.py
src > test > features
src > test > features > example.feature

Is this possible? or should I use a different build tool for behave? and why haven't I been able to import dependencies?

Thanks

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Ana Franco
  • 1,611
  • 3
  • 24
  • 43
  • If your question is still relevant could you provide extra info whether you use virtual environment. Also if you provide the whole project structure and the commands you use to build it. – Alex May 29 '18 at 18:44
  • If you are using defaul pybuild settings make your project structure is correct. Here is a default pybuild project structure http://pybuilder.github.io/documentation/tutorial.html#AddingPythonSourceFiles – Alex May 29 '18 at 18:46
  • There are some pybuild examples available https://github.com/pybuilder/pybuilder/tree/master/samples. – Alex May 29 '18 at 18:47

0 Answers0