question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AssertionError from poetry add Naked

See original GitHub issue
  • I am on the latest Poetry version.

  • I have searched the issues of this repo and believe that this is not a duplicate.

  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).

  • OS version and name: macOS 1015.3 Catalina

  • Poetry version: 1.0.3

  • Link of a Gist with the contents of your pyproject.toml file: https://gist.github.com/shangxiao/50d1f8aa24157a14f759110b552df202

Issue

Running poetry add Naked results in an AssertionError

$ poetry add -vvv Naked
Using virtualenv: /Users/someuser/Library/Caches/pypoetry/virtualenvs/poetry-test-oO20IG-_-py3.6
PyPI: No release information found for Naked-0.1.9, skipping
PyPI: 19 packages found for Naked *
Using version ^0.1.31 for Naked

Updating dependencies
Resolving dependencies...
   1: fact: poetry-test is 0.1.0
   1: derived: poetry-test
   1: fact: poetry-test depends on Naked (^0.1.31)
   1: fact: poetry-test depends on pytest (^5.2)
   1: fact: poetry-test depends on pytest (^5.2)
   1: selecting poetry-test (0.1.0)
   1: derived: pytest (^5.2)
   1: derived: Naked (^0.1.31)
PyPI: 11 packages found for pytest >=5.2,<6.0
PyPI: No release information found for naked-0.1.9, skipping
PyPI: 1 packages found for naked >=0.1.31,<0.2.0
   1: Version solving took 0.030 seconds.
   1: Tried 1 solutions.

[AssertionError]


Traceback (most recent call last):
  File "/Users/someuser/.poetry/lib/poetry/_vendor/py3.6/clikit/console_application.py", line 131, in run
    status_code = command.handle(parsed_args, io)
  File "/Users/someuser/.poetry/lib/poetry/_vendor/py3.6/clikit/api/command/command.py", line 120, in handle
    status_code = self._do_handle(args, io)
  File "/Users/someuser/.poetry/lib/poetry/_vendor/py3.6/clikit/api/command/command.py", line 171, in _do_handle
    return getattr(handler, handler_method)(args, io, self)
  File "/Users/someuser/.poetry/lib/poetry/_vendor/py3.6/cleo/commands/command.py", line 92, in wrap_handle
    return self.handle()
  File "/Users/someuser/.poetry/lib/poetry/console/commands/add.py", line 149, in handle
    status = installer.run()
  File "/Users/someuser/.poetry/lib/poetry/installation/installer.py", line 74, in run
    self._do_install(local_repo)
  File "/Users/someuser/.poetry/lib/poetry/installation/installer.py", line 161, in _do_install
    ops = solver.solve(use_latest=self._whitelist)
  File "/Users/someuser/.poetry/lib/poetry/puzzle/solver.py", line 36, in solve
    packages, depths = self._solve(use_latest=use_latest)
  File "/Users/someuser/.poetry/lib/poetry/puzzle/solver.py", line 181, in _solve
    self._package, self._provider, locked=locked, use_latest=use_latest
  File "/Users/someuser/.poetry/lib/poetry/mixology/__init__.py", line 7, in resolve_version
    return solver.solve()
  File "/Users/someuser/.poetry/lib/poetry/mixology/version_solver.py", line 80, in solve
    next = self._choose_package_version()
  File "/Users/someuser/.poetry/lib/poetry/mixology/version_solver.py", line 381, in _choose_package_version
    for incompatibility in self._provider.incompatibilities_for(version):
  File "/Users/someuser/.poetry/lib/poetry/puzzle/provider.py", line 529, in incompatibilities_for
    for dep in dependencies
  File "/Users/someuser/.poetry/lib/poetry/puzzle/provider.py", line 529, in <listcomp>
    for dep in dependencies
  File "/Users/someuser/.poetry/lib/poetry/mixology/incompatibility.py", line 60, in __init__
    assert by_ref[ref] is not None

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:6
  • Comments:12 (3 by maintainers)

github_iconTop GitHub Comments

41reactions
MatheusR42commented, Oct 4, 2020

@abn , I was using version 1.1.0, but I realized that the problem is that I created a new project with same name of the package. I did this 😅 :


$ poetry new networkx
Created package networkx in networkx
$ cd networkx/
$ poetry add networkx
Creating virtualenv networkx-ij1fzQR9-py3.8 in /home/matheusr42/.cache/pypoetry/virtualenvs
Using version ^2.5 for networkx

Updating dependencies
Resolving dependencies... (0.0s)

  AssertionError

  

  at ~/.poetry/lib/poetry/mixology/incompatibility.py:111 in __str__
      107│         )
      108│ 
      109│     def __str__(self):
      110│         if isinstance(self._cause, DependencyCause):
    → 111│             assert len(self._terms) == 2
      112│ 
      113│             depender = self._terms[0]
      114│             dependee = self._terms[1]
      115│             assert depender.is_positive()

I tried with another project name and it works, thanks! 😁 I think that it is not a big problem, but will be nice if there is a warn message.

9reactions
michaeljonescommented, Oct 27, 2020

I made the same mistake as @MatheusR42. I wanted to play around with py2app so I made a project callec py2app. I didn’t know that would break things. Certainly would appreciate a better message than the line 111 AssertionError. Love Poetry otherwise though 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

IP4DS: Day 1 - Getting Started With Python - Kaggle
Add a single key-value pair fav_color purple to the dictionary dict2 dict2['fav_color'] = 'purple' ... AssertionError : Raised when Assert statement fails.
Read more >
Look here - Python mailing list
You need to really re-read the docs and do some tutors first . Your understanding of classes and namespaces is flawed and will...
Read more >
Programming for Non-Programmers
The sentences “Xander wrote a tone poem for chamber orchestra” and “The ... to this we'll add concepts until we've covered the entire...
Read more >
12795 - Yegor Bugayenko
... ad ad-selling adage adam adams adapt adaptability adapter adblock ADC ADD ... assembly assert assertequals assertion assertionerror assertions asserts ...
Read more >
OHS Honors English Primer - Chris Friend
The Petrarchan conceit compares the subject of the poem to a flower, the sun, or ... A. Add circled words to your Personal...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found