poetry icon indicating copy to clipboard operation
poetry copied to clipboard

Cannot install a package

Open francipvb opened this issue 3 years ago • 3 comments

  • [x] I am on the latest Poetry version.
  • [x] I have searched the issues of this repo and believe that this is not a duplicate.
  • [x] If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).
  • OS version and name: 22.04 Ubuntu under WSL2
  • Poetry version: 1.1.14
  • Link of a Gist with the contents of your pyproject.toml file: Just ran poetry new.

Issue

Hi all,

I have an issue with poetry. I am trying to install picka to write a microservices event middleware without success.

I have an error while trying to install the picka package. The issue is with the assertlib package, see the log below:

Using virtualenv: /home/francipvb/sources/vectman/event-bus/.venv
PyPI: 2 packages found for picka *
Using version ^1.0.1 for picka

Updating dependencies
Resolving dependencies...
   1: fact: event-bus is 0.1.0
   1: derived: event-bus
   1: fact: event-bus depends on picka (^1.0.1)
   1: fact: event-bus depends on pytest (^5.2)
   1: fact: event-bus depends on pytest (^5.2)
   1: selecting event-bus (0.1.0)
   1: derived: pytest (>=5.2,<6.0)
   1: derived: picka[rabbitmq] (>=1.0.1,<2.0.0)
   1: fact: pytest (5.4.3) depends on py (>=1.5.0)
   1: fact: pytest (5.4.3) depends on packaging (*)
   1: fact: pytest (5.4.3) depends on attrs (>=17.4.0)
   1: fact: pytest (5.4.3) depends on more-itertools (>=4.0.0)
   1: fact: pytest (5.4.3) depends on pluggy (>=0.12,<1.0)
   1: fact: pytest (5.4.3) depends on wcwidth (*)
   1: fact: pytest (5.4.3) depends on atomicwrites (>=1.0)
   1: fact: pytest (5.4.3) depends on colorama (*)
   1: selecting pytest (5.4.3)
   1: derived: colorama
   1: derived: atomicwrites (>=1.0)
   1: derived: wcwidth
   1: derived: pluggy (>=0.12,<1.0)
   1: derived: more-itertools (>=4.0.0)
   1: derived: attrs (>=17.4.0)
   1: derived: packaging
   1: derived: py (>=1.5.0)
PyPI: 1 packages found for picka >=1.0.1,<2.0.0
   1: fact: picka (1.0.1) depends on picka (1.0.1)
   1: fact: picka (1.0.1) depends on attrdict (*)
   1: fact: picka (1.0.1) depends on sqlalchemy (*)
   1: fact: picka (1.0.1) depends on assertlib (*)
   1: fact: picka (1.0.1) depends on LatLon (*)
   1: selecting picka[rabbitmq] (1.0.1)
   1: derived: LatLon
   1: derived: assertlib
   1: derived: sqlalchemy
   1: derived: attrdict
   1: derived: picka (==1.0.1)
   1: selecting wcwidth (0.2.5)
   1: selecting pluggy (0.13.1)
   1: selecting more-itertools (8.13.0)
   1: selecting attrs (22.1.0)
   1: fact: packaging (21.3) depends on pyparsing (>=2.0.2,<3.0.5 || >3.0.5)
   1: selecting packaging (21.3)
   1: derived: pyparsing (>=2.0.2,!=3.0.5)
   1: selecting py (1.11.0)
   1: fact: latlon (1.0.2) depends on pyproj (*)
   1: selecting latlon (1.0.2)
   1: derived: pyproj
   1: selecting assertlib (0.3.2)
   1: fact: sqlalchemy (1.4.39) depends on greenlet (!=0.4.17)
   1: selecting sqlalchemy (1.4.39)
   1: derived: greenlet (!=0.4.17)
   1: fact: attrdict (2.0.1) depends on six (*)
   1: selecting attrdict (2.0.1)
   1: derived: six
PyPI: 1 packages found for picka 1.0.1
   1: fact: picka (1.0.1) depends on attrdict (*)
   1: fact: picka (1.0.1) depends on sqlalchemy (*)
   1: fact: picka (1.0.1) depends on assertlib (*)
   1: fact: picka (1.0.1) depends on LatLon (*)
   1: selecting picka (1.0.1)
   1: selecting pyparsing (3.0.9)
   1: fact: pyproj (3.3.1) depends on certifi (*)
   1: selecting pyproj (3.3.1)
   1: derived: certifi
   1: selecting six (1.16.0)
   1: selecting certifi (2022.6.15)
   1: selecting colorama (0.4.5)
   1: selecting atomicwrites (1.4.1)
   1: selecting greenlet (1.1.2)
   1: Version solving took 0.089 seconds.
   1: Tried 1 solutions.

Finding the necessary packages for the current system

Package operations: 2 installs, 0 updates, 0 removals, 17 skipped

  • Removing atomicwrites (1.4.1): Skipped for the following reason: Not currently installed
  • Removing colorama (0.4.5): Skipped for the following reason: Not currently installed
  • Installing certifi (2022.6.15): Skipped for the following reason: Already installed
  • Installing greenlet (1.1.2): Skipped for the following reason: Already installed
  • Installing pyparsing (3.0.9): Skipped for the following reason: Already installed
  • Installing pyproj (3.3.1): Skipped for the following reason: Already installed
  • Installing six (1.16.0): Skipped for the following reason: Already installed
  • Installing assertlib (0.3.2)
  • Installing attrdict (2.0.1): Skipped for the following reason: Already installed
  • Installing attrs (22.1.0): Skipped for the following reason: Already installed
  • Installing latlon (1.0.2): Skipped for the following reason: Already installed
  • Installing more-itertools (8.13.0): Skipped for the following reason: Already installed
  • Installing pluggy (0.13.1): Skipped for the following reason: Already installed
  • Installing packaging (21.3): Skipped for the following reason: Already installed
  • Installing wcwidth (0.2.5): Skipped for the following reason: Already installed
  • Installing sqlalchemy (1.4.39): Skipped for the following reason: Already installed
  • Installing py (1.11.0): Skipped for the following reason: Already installed

  Stack trace:

  7  ~/.local/pipx/venvs/poetry/lib/python3.10/site-packages/poetry/installation/executor.py:203 in _execute_operation
      201│ 
      202│             try:
    → 203│                 result = self._do_execute_operation(operation)
      204│             except EnvCommandError as e:
      205│                 if e.e.returncode == -2:

  6  ~/.local/pipx/venvs/poetry/lib/python3.10/site-packages/poetry/installation/executor.py:277 in _do_execute_operation
      275│             return 0
      276│ 
    → 277│         result = getattr(self, "_execute_{}".format(method))(operation)
      278│ 
      279│         if result != 0:

  5  ~/.local/pipx/venvs/poetry/lib/python3.10/site-packages/poetry/installation/executor.py:412 in _execute_install
      410│ 
      411│     def _execute_install(self, operation):  # type: (Install) -> None
    → 412│         return self._install(operation)
      413│ 
      414│     def _execute_update(self, operation):  # type: (Update) -> None

  4  ~/.local/pipx/venvs/poetry/lib/python3.10/site-packages/poetry/installation/executor.py:450 in _install
      448│             args.insert(2, "-U")
      449│ 
    → 450│         return self.run_pip(*args)
      451│ 
      452│     def _update(self, operation):

  3  ~/.local/pipx/venvs/poetry/lib/python3.10/site-packages/poetry/installation/executor.py:301 in run_pip
      299│     def run_pip(self, *args, **kwargs):  # type: (...) -> int
      300│         try:
    → 301│             self._env.run_pip(*args, **kwargs)
      302│         except EnvCommandError as e:
      303│             output = decode(e.e.output)

  2  ~/.local/pipx/venvs/poetry/lib/python3.10/site-packages/poetry/utils/env.py:1160 in run_pip
      1158│         pip = self.get_pip_command()
      1159│         cmd = pip + list(args)
    → 1160│         return self._run(cmd, **kwargs)
      1161│ 
      1162│     def run_python_script(self, content, **kwargs):  # type: (str, Any) -> str

  1  ~/.local/pipx/venvs/poetry/lib/python3.10/site-packages/poetry/utils/env.py:1453 in _run
      1451│     def _run(self, cmd, **kwargs):
      1452│         kwargs["env"] = self.get_temp_environ(environ=kwargs.get("env"))
    → 1453│         return super(VirtualEnv, self)._run(cmd, **kwargs)
      1454│ 
      1455│     def get_temp_environ(

  EnvCommandError

  Command ['/home/francipvb/sources/vectman/event-bus/.venv/bin/pip', 'install', '--no-deps', 'file:///home/francipvb/.cache/pypoetry/artifacts/e9/3a/0d/95610cf19c56ea81542a10816095d9ca5a16cdb5c54f04788650db654c/assertlib-0.3.2.macosx-10.11-x86_64.tar.gz'] errored with the following return code 1, and output: 
  Processing /home/francipvb/.cache/pypoetry/artifacts/e9/3a/0d/95610cf19c56ea81542a10816095d9ca5a16cdb5c54f04788650db654c/assertlib-0.3.2.macosx-10.11-x86_64.tar.gz
  ERROR: file:///home/francipvb/.cache/pypoetry/artifacts/e9/3a/0d/95610cf19c56ea81542a10816095d9ca5a16cdb5c54f04788650db654c/assertlib-0.3.2.macosx-10.11-x86_64.tar.gz does not appear to be a Python project: neither 'setup.py' nor 'pyproject.toml' found.
  
  [notice] A new release of pip available: 22.1.2 -> 22.2.2
  [notice] To update, run: pip install --upgrade pip
  

  at ~/.local/pipx/venvs/poetry/lib/python3.10/site-packages/poetry/utils/env.py:1195 in _run
      1191│                 output = subprocess.check_output(
      1192│                     cmd, stderr=subprocess.STDOUT, **kwargs
      1193│                 )
      1194│         except CalledProcessError as e:
    → 1195│             raise EnvCommandError(e, input=input_)
      1196│ 
      1197│         return decode(output)
      1198│ 
      1199│     def execute(self, bin, *args, **kwargs):


Failed to add packages, reverting the pyproject.toml file to its original content.

I updated pip with the same result.

Thank you.

francipvb avatar Aug 08 '22 11:08 francipvb

The relevant part of the log is assertlib-0.3.2.macosx-10.11-x86_64.tar.gz does not appear to be a Python project: neither 'setup.py' nor 'pyproject.toml' found.

On a quick glance, that's just true. The folder structure of the archive seems to be wrong. Thus, an assertlib issue, not a poetry issue.

radoering avatar Aug 08 '22 15:08 radoering

Hello,

The relevant part of the log is assertlib-0.3.2.macosx-10.11-x86_64.tar.gz does not appear to be a Python project: neither 'setup.py' nor 'pyproject.toml' found.

On a quick glance, that's just true. The folder structure of the archive seems to be wrong. Thus, an assertlib issue, not a poetry issue.

Why there is a MacOSX version being downloaded? If I install with pip there is no issue. I tried also using pipenv with same result.

francipvb avatar Aug 08 '22 15:08 francipvb

From poetry's point of view, there are two sdists for assertlib:

  • assertlib-0.3.2.tar.gz
  • assertlib-0.3.2.macosx-10.11-x86_64.tar.gz

Both seem equally suitable according to https://github.com/python-poetry/poetry/blob/601dc7896c812d39b75f2358b17a9460561d3866/src/poetry/installation/chooser.py#L151-L211

Thus, it's more or less coincidence which of both is chosen. It seems pip decides for the first and poetry for the second.

According to https://pypi.org/project/assertlib/#files it seems that PyPI doesn't recognize the second archive as sdist but as bdist. One could argue if the chooser logic should be adapted to comply with pip. However, I think that's a weird edge case and will not be a priority.

radoering avatar Aug 08 '22 16:08 radoering

I think everything about the causes of the issue was already said. Closing, since the issue is upstream and there is nothing Poetry can do about it.

Secrus avatar Aug 31 '22 07:08 Secrus

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[bot] avatar Mar 01 '24 14:03 github-actions[bot]