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
0 answers

I am using Poetry for python package dependency

I am using poetry on my project. but I have encountered an import module error when importing the redis package. When i install the redis package from pip, that install is successful and the import module is successful too. But poetry can't import…
Seobee
  • 1
0
votes
0 answers

Import swagger_client into python project to run strava API

I'm trying to do some basic programming in Python, I want to be able to pull, post & edit my own data from strava. I'm pretty new to programming, I'm using this as my 'capstone' project to develop my skills. See…
0
votes
1 answer

No module named seaborn even if I installed it

I got a problem with seaborn. When I run poetry, the shell said that No module named 'seaborn' even I install it by pip install seaborn: $ pip install seaborn Requirement already satisfied: seaborn in…
Dylan Harris
  • 37
  • 1
  • 1
  • 6
0
votes
1 answer

ModuleNotFoundError for 'modin' even though it is installed by poetry

On import modin.pandas as modin_pd line I get ModuleNotFoundError: No module named 'modin'. I am using poetry & JupyterLab. If in the cell I type !poetry add modin, I get ValueError saying Package modin is already present. So it cannot install modin…
Valeria
  • 1,508
  • 4
  • 20
  • 44
0
votes
0 answers

poetry tries to install project folder as a dependency: EnvCommandError

I am trying to run poetry install command, but I get the following error: [EnvCommandError] Command ['pip', 'install', '-e', ''] errored with the following return code 1, and output: Obtaining…
Valeria
  • 1,508
  • 4
  • 20
  • 44
0
votes
1 answer

Make tox/pip recognize a private artifactory for a poetry package deployed with Jenkins

I have a python package I want to test and build using Jenkins and tox. However, it depends on a package in our private artifactory. Although poetry picks up on it correctly, the moment tox kicks in (and uses pip over poetry to install…
Sander
  • 412
  • 2
  • 14
0
votes
1 answer

Poetry (pyproject.toml) support both Python 2 and 3

I have a package (usignals) that needs to support both Python 2 and 3. In my pyproject.toml, I have this: [tool.poetry.dependencies] python = ">=2.7, >=3.6" and [tool.poetry.dev-dependencies] ipython = [ {version = "~5", python = "~2.7"}, …
Sardathrion - against SE abuse
  • 17,269
  • 27
  • 101
  • 156
0
votes
2 answers

Poetry unwanted access to packages beyond env

It was my understanding that the virtual env created by poetry would by default not give access to any packages outside that env, not even the ones installed in the system directory (such a feature is being added in…
piccolbo
  • 1,305
  • 7
  • 17
0
votes
0 answers

No module named 'pyparsing' when executing "poetry install" on Azure pipelines

First of all, I'm not sure whether this is a problem of Windows, poetry, or pyparsing, as I don't have a Windows environment to reproduce this error. But here's what happens when I run my tests on Azure…
laike9m
  • 18,344
  • 20
  • 107
  • 140
0
votes
1 answer

Is there any way in vscode to map command `pip install` to `poetry add`?

I'm trying to use python-poetry as dependency manager for my Python projects. I prefer to use VSCode for my development. However, vscode doesn't have support for poetry yet, that means any packages installed via vscode are installed using pip. I…
techNoob
  • 31
  • 5
-1
votes
2 answers

What is the best practices to have multiple poetry versions with different python versions in linux?

I have to work on two projects, one with a version of Python 3.7 and the other with 3.10, but every time I need to switch from one to another I have to reinstall poetry. Any idea, to avoid reinstall poetry?
-1
votes
1 answer

Bash script not sourcing

In my folder where I keep my other bash scripts, I have created this one: #! /bin/bash source $(poetry env info --path)/bin/activate In a file named poetry_activate. In a bash terminal, the autocomplete works, and when I enter poetry_activate, the…
An old man in the sea.
  • 1,169
  • 1
  • 13
  • 30
-1
votes
1 answer

ERROR: ".Content was unexpected at this time." while installing poetry

I am trying to install poetry in my windows system. The command that I am using is (Invoke-WebRequest -Uri https://install.python-poetry.org -UseBasicParsing).Content | py - From official docs here. However, I`m getting the following…
Lakshay Rohilla
  • 1,654
  • 6
  • 9
  • 30
-1
votes
1 answer

Poetry cannot import from subfolders in scripts runned by "poetry run"

Project structure is like this: . ├── README.md ├── pyproject.toml ... my_project_name/ ├── moduleA.py ├── moduleB.py └── FolderC └── moduleC.py moduleA.py: from .moduleB import moduleB_func from .FolderC.moduleC import…
-1
votes
1 answer

mypy throws "error: Too many arguments for 'object'" on pre-commit hook run but not on local run

from typing import Callable, Type, TypeVar T = TypeVar("T") def repo(class_: Type[T]) -> Callable: def instantiate(*args, **kwargs) -> T: return class_(*args, **kwargs) return instantiate Code above throws "error: Too many…
1 2 3
73
74