Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

351
Views
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
over 4 years ago · Santiago Trujillo
6 answers
Answer question

0

Try upgrading poetry itself: pip install -U poetry. Worked for me to resolve SQLAlchemy issue.

over 4 years ago · Santiago Trujillo Report

0

If you use

poetry add sqlalchemy=1.4.22

This will solve your problem

over 4 years ago · Santiago Trujillo Report

0

Try poetry self update, then poetry update.

over 4 years ago · Santiago Trujillo Report

0

I tried fl_'s answer but poetry self update itself failed for me with an error saying:

ModuleNotFoundError: No module named 'poetry.console'

From a stackoverflow answer to a different question I learned that I had poetry installed using the older, now deprecated, get-poetry.py.

So I uninstalled poetry like so:

curl https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py > get-poetry

python get-poetry --uninstall

Then reinstalled it with the newer install-poetry.py as per official installation instructions.

This finally made the original AttributeError go away.

over 4 years ago · Santiago Trujillo Report

0

Same here, it seems to be a very recent problem. The good news is that "poetry self update" fixes the issue

over 4 years ago · Santiago Trujillo Report

0

Upgrading poetry to 1.1.8 may solve the issue.

e.g. use poetry self update (related docs)

Check related poetry issue too:

https://github.com/python-poetry/poetry/issues/4410#issuecomment-902144234

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!