I am exploring the use of Poetry
for packaging my Python's applications.
I started using Poetry
on an already existing project. The structure is like this :
├─ bin
| └─ main.py
├─ docs
├─ data
├─ src
│ └─ packagename
│ ├─ __init__.py
│ └─ ...
├─ tests
│ └─ ...
└─ pyproject.toml
I had a virtualenv
already set up. So I executed the following commands to Poetry
:
poetry init (inside the package directory)
poetry add *package lists*
I checked Poetry
is recognizing the virtualenv
with the command :
poetry env info
and this gave the expected result.
So now, I would like to test my package i.e. run the main.py
script which does (among other things):
import packagename
To achieve this, I executed :
poetry install
poetry run bin\main.py
but the poetry run
command throws a ModuleNotFoundError : No module named 'packagename'
. What am I not understanding/doing wrong ?