I have a local package, "mypackage", inside a venv environment. I successfully ran poetry install
and I'm able to import it into Python sessions started inside of the same virtual env. Now I want to use mypackage in other projects and environments on my machine, specifically a pipenv environment setup for "myproject".
I followed the steps here: Install the latest version of my package from working directory into my local environment using Python's poetry But that leads to: Poetry could not find a pyproject.toml file in C:\Users\jonathan.biemond\PycharmProjects\myproject or its parents
Do I need to have a pyproject.toml file in my project directory to import mypackage? myproject is not a package, just a local, undistributed project, so I don't have dependencies to maintain...
Here are my steps to setup mypackage:
- Create venv for mypackage:
python -m venv
pip install poetry
poetry init
from mypackage directory to create pyproject.toml for mypackagepoetry install
Now I can use mypackage in the same virtual environment it was created in.
But I also want to use it in another virtual environment. Here are my steps to import mypackage:
pipenv install numpy
from myproject directory to create environment (and install numpy)- Install poetry:
(Invoke-WebRequest -Uri https://install.python-poetry.org -UseBasicParsing).Content | py -
- Install mypackage:
poetry install mypackage