Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing SQLAlchemy with Poetry causes an AttributeErrorr

When installing with pip, pip install sqlalchemy all is ok.

When installing with poetry I am getting the error

➜  backend poetry add sqlalchemy
Using version ^1.4.23 for SQLAlchemy

Updating dependencies
Resolving dependencies... (0.1s)

  AttributeError

  'EmptyConstraint' object has no attribute 'allows'

  at ~/.poetry/lib/poetry/_vendor/py3.8/poetry/core/version/markers.py:291 in validate
      287│
      288│         if self._name not in environment:
      289│             return True
      290│
    → 291│         return self._constraint.allows(self._parser(environment[self._name]))
      292│
      293│     def without_extras(self):  # type: () -> MarkerTypes
      294│         return self.exclude("extra")
      295│
➜  backend
like image 484
Maksych Avatar asked Aug 19 '21 16:08

Maksych


People also ask

Is SQLAlchemy a built in package in Python?

Python Flask and SQLAlchemy ORM SQLAlchemy is a popular SQL toolkit and Object Relational Mapper. It is written in Python and gives full power and flexibility of SQL to an application developer. It is an open source and cross-platform software released under MIT license.

How install SQLAlchemy in Windows?

Installing SQLAlchemy on Windows You can install it by double clicking the . msi file. After you have installed Python on your Windows system, you can download the source code of SQLAlchemy from SQLAlchemy Download Page and install it using its setup.py script. Plain-Python build succeeded.

Is SQLAlchemy a package?

The SQLAlchemy Toolkit and Object Relational Mapper is an extensive set of utilities for working with Python and databases. This toolkit provides a package full of popular persistence patterns, designed for economical and robust database accessibility.


2 Answers

Try poetry self update, then poetry update.

like image 140
fl_ Avatar answered Sep 19 '22 09:09

fl_


If you use

poetry add sqlalchemy=1.4.22

This will solve your problem

like image 22
Ntjs95 Avatar answered Sep 19 '22 09:09

Ntjs95