-
Notifications
You must be signed in to change notification settings - Fork 2.3k
ModuleNotFoundError for poetry script #3928
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
Comments
Hello @anthonyatp, [tool.poetry.scripts]
demo_script = "src.blueprints.foo.a:demo_script" the [tool.poetry.scripts]
demo_script = "blueprints.foo.a:demo_script" |
Hi @finswimmer, I did initially have it as:
However, when I do, it doesn't allow me to run the script for the same reason:
|
I have the same problem. |
Windows 10, python 3.9, poetry 1.1.11 in my case. For a tool.poetry.script, poetry creates 2 files:
Running However |
I'm hitting the same problem and I'm curious if this is a bug and I can try to raise a PR or there is something I don't understand about how I should use a package with more python files in it. It seems a basic need, though. |
Hello, I have the same issue. The folder structure of my project is:
file1 imports a function from file2, file1.py
This is my pyproject.toml
When I do : I get the error:
Any ideas on what am I missing? |
@kmilo9999 you need to make the following changes.
|
@anthonyatp based on your last response I think your layout is problematic. If you have an src directory at the same level as your toml file then, you need Closing this issue as this is a configuration issue. |
I had the exact same problem and could not get any of the solutions to work. Found a work around using a init.py file containing |
I had the exact same problem and could not get any of the solutions to work. |
I'm hitting the same issue with no clue why imports do not work in a very standard setup. Here is what docs say:
Here is what I have:
I get the following error, when I run
|
Hey, this issue is long closed. Please open a new issue with a reproducer. Thanks a lot. fin swimmer |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Issue
I am running a script in a sub dir - however, when it runs, it doesn't recognise local modules.
This is related to #1868 - however
poetry install
doesn't resolve my issue.Here is a rough layout of the app:
a.py
pyproject.toml
But when I run it using
poetry run demo_script
, it can't find the local modules:Please let me know if you need any further info.
Thanks!
The text was updated successfully, but these errors were encountered: