Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

failed to find module or file: yp #1

Open
hyer opened this issue Feb 10, 2023 · 1 comment
Open

failed to find module or file: yp #1

hyer opened this issue Feb 10, 2023 · 1 comment

Comments

@hyer
Copy link

hyer commented Feb 10, 2023

I have installed the version of 0.2.1 with pip, and create a script hello.py with:

import yape as yp

@yp.nodeop
def hello(who="world"):
    print(f"Hello, {who}!")

I run in cmd with yape, but got error:

Traceback (most recent call last):
  File "/usr/local/bin/yape", line 8, in <module>
    sys.exit(run())
  File "/usr/local/lib/python3.8/site-packages/yape/__main__.py", line 4, in run
    exit(cli.run())
  File "/usr/local/lib/python3.8/site-packages/yape/climodule.py", line 32, in run
    self.__load_yp()
  File "/usr/local/lib/python3.8/site-packages/yape/climodule.py", line 80, in __load_yp
    raise RuntimeError(f'failed to find module or file: {name}')
RuntimeError: failed to find module or file: yp

Env:
MacOS, python3.8

@guludo
Copy link
Owner

guludo commented Mar 2, 2023

Hello @hyer!

Your file should be named yp.py instead of hello.py. If you prefer to use the latter, you can run yape --yp hello tell it to use the alternate module name.

Also note that your example will also fail because you are using @yp.nodeop. I think you meant to use @yp.node instead.

Btw, I just made a new release (0.3.0).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants