Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

poetry 1.3.0 and pillow issues on linux ubuntu 20.04 x86_64 #7177

Closed
3 of 4 tasks
alanwilter opened this issue Dec 11, 2022 · 13 comments
Closed
3 of 4 tasks

poetry 1.3.0 and pillow issues on linux ubuntu 20.04 x86_64 #7177

alanwilter opened this issue Dec 11, 2022 · 13 comments
Labels
status/duplicate Duplicate issues

Comments

@alanwilter
Copy link

alanwilter commented Dec 11, 2022

  • Poetry version: 1.3.0
  • Python version: 3.8.10
  • OS version and name: Ubuntu 20.04.3 LTS
  • I am on the latest stable Poetry version, installed using a recommended method.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • I have consulted the FAQ and blog for any relevant entries or release notes.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option) and have included the output below.

Issues

poetry new pillow
cd pillow0 
python3 -m venv venv
source venv/bin/activate
poetry add pillow
Using version ^9.3.0 for pillow

Updating dependencies
Resolving dependencies... (0.0s)

  AssertionError



  at ~/.local/share/pypoetry/venv/lib/python3.8/site-packages/poetry/mixology/incompatibility.py:113 in __str__
      109│         )
      110│
      111│     def __str__(self) -> str:
      112│         if isinstance(self._cause, DependencyCause):
    → 113│             assert len(self._terms) == 2
      114│
      115│             depender = self._terms[0]
      116│             dependee = self._terms[1]
      117│             assert depender.is_positive()

Why I cannot have a project with 'pillow' name?

Moving on the real issue.

poetry new pillow0
cd pillow0 
python3 -m venv venv
source venv/bin/activate
poetry add pillow
Using version ^9.3.0 for pillow

Updating dependencies
Resolving dependencies... (0.2s)

Writing lock file

Package operations: 1 install, 0 updates, 0 removals

  • Installing pillow (9.3.0): Failed

  CalledProcessError

  Command '['/home/awilter/pillow0/venv/bin/python', '-m', 'pip', 'install', '--disable-pip-version-check', '--isolated', '--no-input', '--prefix', '/home/awilter/pillow0/venv', '--no-deps', '/home/awilter/.cache/pypoetry/artifacts/59/9d/df/d05d21afe388f4f46ff21539322db49285ee2b2817e681963c0a08dcad/Pillow-9.3.0-cp38-cp38-manylinux_2_28_x86_64.whl']' returned non-zero exit status 1.

  at /usr/lib/python3.8/subprocess.py:516 in run
       512│             # We don't call process.wait() as .__exit__ does that for us.
       513│             raise
       514│         retcode = process.poll()
       515│         if check and retcode:
    →  516│             raise CalledProcessError(retcode, process.args,
       517│                                      output=stdout, stderr=stderr)
       518│     return CompletedProcess(process.args, retcode, stdout, stderr)
       519│
       520│

The following error occurred when trying to handle this error:


  EnvCommandError

  Command ['/home/awilter/pillow0/venv/bin/python', '-m', 'pip', 'install', '--disable-pip-version-check', '--isolated', '--no-input', '--prefix', '/home/awilter/pillow0/venv', '--no-deps', '/home/awilter/.cache/pypoetry/artifacts/59/9d/df/d05d21afe388f4f46ff21539322db49285ee2b2817e681963c0a08dcad/Pillow-9.3.0-cp38-cp38-manylinux_2_28_x86_64.whl'] errored with the following return code 1, and output:
  ERROR: Pillow-9.3.0-cp38-cp38-manylinux_2_28_x86_64.whl is not a supported wheel on this platform.


  at ~/.local/share/pypoetry/venv/lib/python3.8/site-packages/poetry/utils/env.py:1540 in _run
      1536│                 output = subprocess.check_output(
      1537│                     command, stderr=subprocess.STDOUT, env=env, **kwargs
      1538│                 )
      1539│         except CalledProcessError as e:
    → 1540│             raise EnvCommandError(e, input=input_)
      1541│
      1542│         return decode(output)
      1543│
      1544│     def execute(self, bin: str, *args: str, **kwargs: Any) -> int:

The following error occurred when trying to handle this error:


  PoetryException

  Failed to install /home/awilter/.cache/pypoetry/artifacts/59/9d/df/d05d21afe388f4f46ff21539322db49285ee2b2817e681963c0a08dcad/Pillow-9.3.0-cp38-cp38-manylinux_2_28_x86_64.whl

  at ~/.local/share/pypoetry/venv/lib/python3.8/site-packages/poetry/utils/pip.py:58 in pip_install
       54│
       55│     try:
       56│         return environment.run_pip(*args)
       57│     except EnvCommandError as e:
    →  58│         raise PoetryException(f"Failed to install {path.as_posix()}") from e
       59│

But I have no problem if doing:

pip install pillow
Collecting pillow
  Using cached Pillow-9.3.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.2 MB)
Installing collected packages: pillow
Successfully installed pillow-9.3.0

Do you notice that poetry tries to install Pillow-9.3.0-cp38-cp38-manylinux_2_28_x86_64.whl while pip installs, successfully, Pillow-9.3.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

What is poetry trying to do here?

@alanwilter alanwilter added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Dec 11, 2022
@neersighted
Copy link
Member

neersighted commented Dec 11, 2022

There are two issues here; the first is you cannot have your project named the same as a dependency. This is because Python packages (and also importable modules, though it is a M:N relationship) have a flat namespace. Clearly we could better detect and warn about this error instead of throwing an AssertionError (cc @radoering @dimbleby), but there is no bug, just poor messaging.

I'd appreciate opening a new issue narrowly targeting the case of package name collisions with a dependency.

The second issue is a duplicate of #7161 and caused because pip and Poetry now disagree on wheel tags and pip is used by Poetry, but the pip version is uncontrolled as we're using the version present in your target virtual environment.

See that issue for details; but in general this kind of issue is rare but can happen until we finish the work in #6205.

@neersighted neersighted closed this as not planned Won't fix, can't repro, duplicate, stale Dec 11, 2022
@neersighted neersighted added status/duplicate Duplicate issues and removed kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Dec 11, 2022
@alanwilter
Copy link
Author

Many thanks for your quick reply.

@dimbleby
Copy link
Contributor

dimbleby commented Dec 12, 2022

I think this actually isn't #7161: or rather it's a demonstration that the same issue has existed, in principle, for some time now.

packaging 21.3 on my 20.4 ubuntu system includes the tag "cp38-cp38-manylinux_2_28_x86_64".

So most likely this particular example could be solved by the user updating their pip installation.

@alanwilter
Copy link
Author

Thanks @dimbleby, indeed by doing:

poetry new pillow0
cd pillow0 
python3 -m venv venv
source venv/bin/activate
pip install pip -U
poetry add pillow
Using version ^9.3.0 for pillow

Updating dependencies
Resolving dependencies... (0.2s)

Writing lock file

Package operations: 1 install, 0 updates, 0 removals

  • Installing pillow (9.3.0)

It worked as expected.

@neersighted
Copy link
Member

Looks like #7161 in aggregate, but not in specifics, indeed. I think what distinguishes that issue is that it relates to platform and can be worked around/is not yet fixed in a new pip release, whereas this issue is just a stale pip. We could likely create a FAQ entry for this directing users to upgrade pip.

@alanwilter
Copy link
Author

Or add in poetry code a warning, in the same way pip does when it detects an outdated version.

@neersighted
Copy link
Member

Without maintaining a table of pip versions, that is not a very tractable solution, and the table of versions is very manual and prone to inaccuracies. I don't think that is a useful approach to take.

@alanwilter
Copy link
Author

I'm just wondering how then pip does it?

@neersighted
Copy link
Member

Oh, you're suggesting unconditionally instructing the user to upgrade pip. pip pings a remote server and it's an implementation detail, but I don't think we can depend on their infrastructure in a maintainable way.

In any case, we're on the cusp of dropping pip, so I think this is mostly immaterial.

@alanwilter
Copy link
Author

Many thanks for the clarification. I got a much better understanding.

@kabartay
Copy link

pip 22+ resolves the issue.

@alanwilter
Copy link
Author

Yes, I can confirm that this is now working fine for me too, with pip 22+.

Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status/duplicate Duplicate issues
Projects
None yet
Development

No branches or pull requests

4 participants