Questions tagged [python-poetry]

Poetry is a Python tool to handle dependency installation, as well as the building and packaging of Python packages. Do NOT use this tag for poems written in the Python language, since this is off-topic on Stack Overflow.

Poetry is a Python tool to handle dependency installation as well as building and packaging of Python packages. Do not use this tag for poems written in Python language since this is off-topic on Stack Overflow.

What are the advantages of Poetry compared to other types of package management? From the documentation:

Packaging systems and dependency management in Python are rather convoluted and hard to understand for newcomers. Even for seasoned developers it might be cumbersome at times to create all files needed in a Python project: setup.py, requirements.txt, setup.cfg, MANIFEST.in and the newly added Pipfile.

So I wanted a tool that would limit everything to a single configuration file to do: dependency management, packaging and publishing.

It takes inspiration in tools that exist in other languages, like Composer (PHP) or Cargo (Rust).

And, finally, there is no reliable tool to properly resolve dependencies in Python, so I started poetry to bring an exhaustive dependency resolver to the Python community.

1108 questions
15
votes
2 answers

Install multiple private packages from Github using Poetry and deploy keys

I want to install multiple private Github repositories as python packages into my repository using poetry. This works fine when running poetry install locally as I have my public SSH key added to Github which allows poetry to access the private…
Joachim
  • 567
  • 1
  • 7
  • 20
15
votes
1 answer

Python-poetry error: Setting settings.virtualenvs.in-project does not exist

I am setting poetry to create virtual environments in the project directory. I entered: poetry config settings.virtualenvs.in-project true and received error [ValueError] Setting settings.virtualenvs.in-project does not exist Also there is the…
mascai
  • 1,373
  • 1
  • 9
  • 30
15
votes
2 answers

poetry can't find version of dependency even though it exists

When bumping my python version from 3.7 to 3.8 in poetry, reinstalling all the dependencies fail with a version of the following: ERROR: No matching distribution found for... The distribution for that version is available at pypa, and is often the…
arshbot
  • 12,535
  • 14
  • 48
  • 71
15
votes
3 answers

What is the default install path for poetry

I installed poetry, however I'm getting the following error when attempting to call poetry zsh: command not found: poetry I know I have it installed because I get the following output when trying to run the following install script $ curl -sSL…
arshbot
  • 12,535
  • 14
  • 48
  • 71
14
votes
2 answers

Could not find poetry-1.2.2-linux.sha256sum file

I am trying to update my version of Poetry to 1.2.*, but when running poetry self update I get the error Could not find poetry-1.2.2-linux.sha256sum file... I can't figure out how to try and update Poetry to an earlier version for which hopefully…
Harry Stuart
  • 1,781
  • 2
  • 24
  • 39
14
votes
1 answer

How poetry knows my package is located in the src folder?

I have a simple question. I used to create a poetry project with my package at root. project.toml mypackage +- __init__.py +- mypackage.py +- test_mypackage.py I recently moved my tests in another directory, so that the folder now looks…
emonier
  • 293
  • 1
  • 3
  • 13
14
votes
2 answers

import local package during poetry run

I just transitioned from pipenv to poetry and I'm having trouble importing a package from a local package I'm developing in a few of my scripts. To make this more concrete, my project looks something like: pyproject.toml poetry.lock bin/ …
dino
  • 3,093
  • 4
  • 31
  • 50
14
votes
2 answers

How does the Python tool Poetry know the path of a project's virtual environment?

My question: How does the Python tool Poetry know the path of the virtual environment of a project? Explanation: When I run poetry init inside a directory, a new project is created. Then I run poetry install and a new virtual environment is created.…
tyrex
  • 8,208
  • 12
  • 43
  • 50
14
votes
2 answers

How does Poetry work regarding binary dependencies? (esp. numpy)

Until now I have been using conda as virtual environment and dependency management. However, some stuff does not work as expected when transfering my environment.yml file from my development machine to the production server. Now, I would like to…
Make42
  • 12,236
  • 24
  • 79
  • 155
14
votes
1 answer

No module named 'Cython' with pip installation of tar.gz

I use Poetry to build tar.gz and whl files for my example package (https://github.com/iamishalkin/cyrtd) and then try to install package inside pipenv environment. tar.gz installation fails and this is a piece of logs: $ poetry build ... $ pip…
Ivan Mishalkin
  • 1,049
  • 9
  • 25
13
votes
4 answers

What is the python-poetry config file after 1.2.0 release?

I have been using python-poetry for over a year now. After poetry 1.2.0 release, I get such an info warning: Configuration file exists at ~/Library/Application Support/pypoetry, reusing this directory. Consider moving configuration to…
SADIK KUZU
  • 345
  • 1
  • 3
  • 13
13
votes
1 answer

How to create a brand new virtual environment or duplicate an existing one in poetry? (Multiple environment in a project)

I have a project and an existing virtual environment created with poetry (poetry install/init). So, as far as I know, the purpouse of a virtual environment is avoiding to modify the system base environment and the possibility of isolation (per…
J_Zar
  • 2,034
  • 2
  • 21
  • 34
13
votes
2 answers

How do I set an environment variable dynamically when using poetry shell?

When I activate a virtual environment via poetry shell, GPG signing gets messed up because $GPG_TTY is set for the parent shell. So every time I use poetry shell I have to do GPG_TTY=$(tty). Is there a way to do this automatically? Ideally I would…
willclarktech
  • 197
  • 1
  • 2
  • 11
13
votes
4 answers

How can I publish Python packages to CodeArtifact using Poetry?

Trying to publish a Poetry package to AWS CodeArtifact. It supports pip which should indicate that it supports poetry as well since poetry can upload to PyPi servers. I've configured the domain like so: export CODEARTIFACT_AUTH_TOKEN=`aws…
Shay Nehmad
  • 1,103
  • 1
  • 12
  • 25
13
votes
1 answer

How to create a deb package for a python project without setup.py

Any documentation I've found about this topic mentions that the "only" requirement to build a deb package is to have a correct setup.py (and requirements.txt). For instance in dh-virtualenv tutorial, stdeb documentation and the Debian's library…
zezollo
  • 4,606
  • 5
  • 28
  • 59