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
0
votes
1 answer

Mypy vers. 0.761 and 0.812: there are dramatic differences in type syntax requirements. Any way around them?

mypy 0.812 allows the following useful type hint: def foo(a: str, b: str) -> str: return a + b def bar(foo_fn: Callable[[str,str],str]) -> str: return foo_fn("foo","bar") Bottom line is: you can remember virtually everything, but a few type…
Chris
  • 28,822
  • 27
  • 83
  • 158
0
votes
1 answer

Poetry forces use of old version of Mypy

Poetry yields the following error on request to upgrade mypy: depends on both mypy (^0.812) and mypy (^0.761), version solving failed mypy v0.761 considers type specification with bracket arguments (e.g., Callable[[],Any]) to be a…
Chris
  • 28,822
  • 27
  • 83
  • 158
0
votes
1 answer

pip list doesn't show location correctly when installing with poetry

Earlier when I poetry installed my local package its correct path used to be shown when I pip list Old versions poetry: 1.0.2 pip list package version location ---------- …
Origin
  • 1,182
  • 1
  • 10
  • 25
0
votes
1 answer

poetry [EnvCommandError] Fatal Python error: Py_Initialize: can't initialize sys standard streams

I have a pyproject.toml file that was created using poetry, and I'm trying to run the command poetry install in this directory to create a poetry.lock file. However, when I run poetry install, I get the following error: EnvCommandError Command…
mmarion
  • 859
  • 8
  • 20
0
votes
2 answers

arguments to pip should be passed from tox or poetry or shell?

A project uses tox and poetry to manage the Python environment during continuous integration (CI) testing (install Python packages before running tests). The project root directory has files /tox.ini and /pyproject.toml. In the CI workflow, a shell…
JamesThomasMoon
  • 6,169
  • 7
  • 37
  • 63
0
votes
0 answers

poetry dependencies python3.4 with httpx

I'm to use pyproject.toml with poetry (1.1.5, latest). I want my package supports python>=3.4, and, if it's python>=3.6 then depends on httpx, too. Thus, the pyproject.toml is: [tool.poetry.dependencies] python = "^3.X" httpx = {version =…
pjw91
  • 1,745
  • 1
  • 11
  • 8
0
votes
0 answers

Cant add any package with poetry while using pyenv

I decided to try combo of pyenv and poetry. And after creating test project and adding dependencies to it I always have the same error. Why poetry is trying to use not existing wheels, pip and setuptools? Maybe there are some configurations to be…
0
votes
0 answers

How do I add a Python3.6.1+ dev dependency in a Python3.6 project with poetry

I have a poetry file with [tool.poetry.dependencies] python = "^3.6" which I can't change. I would like to add pre-commit as a depdenency, but I get $ poetry add pre-commit --dev Using version ^2.11.1 for pre-commit Updating dependencies Resolving…
ignoring_gravity
  • 6,677
  • 4
  • 32
  • 65
0
votes
1 answer

How to use poetry for recursive installation?

I'm trying to install this repository using poetry package manager. Here's how it's done using pip: git clone --recursive https://github.com/parlance/ctcdecode.git cd ctcdecode && pip install . But if I try to run poetry add ctcdecode It fails…
Jubick
  • 402
  • 3
  • 15
0
votes
0 answers

ModuleNotFoundError: No module named after poetry install

Using DockerFile to build python application, Library will be built from source code added in [tool.poetry.dependencies] facing problem when the container runs it raises ModuleNotFoundError: No module named 'rasa_addons' Snap from…
ahmed osama
  • 621
  • 2
  • 12
  • 21
0
votes
0 answers

Cant add plugin in poetry

I have initialized poetry in my project. Add some libs and got this pyproject.toml: [tool.poetry] name = "dataapi" version = "0.1.0" description = "API for service." authors = ["Claus Stolz"] [tool.poetry.dependencies] python = "^3.8" gino =…
Claus Stolz
  • 358
  • 4
  • 18
0
votes
1 answer

Poetry install fails with EnvCommandError

I am using macOS BigSur 11.1, poetry 1.1.4 and python 3.8.6. In my poetry project I try to run poetry add pillow, but it results in EnvCommandError. The headers or library files could not be found for jpeg, a required dependency when compiling…
0
votes
1 answer

UnicodeEncodeError: 'ascii' codec can't encode character u'\u2018' in position 15564: ordinal not in range(128)

When I try to execute the poetry add pyarrow command in the directory where my poetry.lock file is I get the following error (see title). I tried using a specific or the lastest version of poetry but the error stays there. I have the latest version…
Giorgio Maritano
  • 341
  • 1
  • 3
  • 12
0
votes
2 answers

ModuleNotFoundError when importing my package, but not when running it alone

I'm trying to create a python package, and I have have trouble with the imports. My code works as expected when running it, but when I install the package using poetry and import it in another script, I have a ModuleNotFoundError. My file structure…
0
votes
0 answers

How to use Poetry when developing a package?

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 │ └─…
FenryrMKIII
  • 1,068
  • 1
  • 13
  • 30