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

Library installation error using 1.2.0 #6407

Closed
1 of 3 tasks
ijufumi opened this issue Sep 5, 2022 · 3 comments
Closed
1 of 3 tasks

Library installation error using 1.2.0 #6407

ijufumi opened this issue Sep 5, 2022 · 3 comments
Labels
kind/question User questions (candidates for conversion to discussion) status/external-issue Issue is caused by external project (platform, dep, etc)

Comments

@ijufumi
Copy link

ijufumi commented Sep 5, 2022

  • 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:
    • Debian (bullseys)
  • Poetry version:
    • 1.2.0

Issue

I couldn't install mplcursors.
The steps I executed are the below.

  • pip install poetry
  • poetry init
  • poetry install mplcursors

And then, error is the below.

root@358c0fc34331:~/test# poetry add mplcursors
Using version ^0.5.1 for mplcursors

Updating dependencies
Resolving dependencies... (8.1s)

Package operations: 1 install, 0 updates, 0 removals

  • Installing mplcursors (0.5.1): Failed

  EnvCommandError

  Command ['/root/.cache/pypoetry/virtualenvs/test-DVdBw2hf-py3.10/bin/pip', 'install', '--no-deps', 'file:///root/.cache/pypoetry/artifacts/3e/7f/e0/768ee11328be8de8463e8559fc6cd4b64fdc4b063c37530d70c9c426a9/mplcursors-0.5.1.tar.gz'] errored with the following return code 1, and output:
  Processing /root/.cache/pypoetry/artifacts/3e/7f/e0/768ee11328be8de8463e8559fc6cd4b64fdc4b063c37530d70c9c426a9/mplcursors-0.5.1.tar.gz
    Installing build dependencies: started
    Installing build dependencies: finished with status 'done'
    Getting requirements to build wheel: started
    Getting requirements to build wheel: finished with status 'error'
    error: subprocess-exited-with-error

    × Getting requirements to build wheel did not run successfully.
    │ exit code: 1
    ╰─> [25 lines of output]
        Traceback (most recent call last):
          File "/root/.cache/pypoetry/virtualenvs/test-DVdBw2hf-py3.10/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
            main()
          File "/root/.cache/pypoetry/virtualenvs/test-DVdBw2hf-py3.10/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
            json_out['return_val'] = hook(**hook_input['kwargs'])
          File "/root/.cache/pypoetry/virtualenvs/test-DVdBw2hf-py3.10/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 130, in get_requires_for_build_wheel
            return hook(config_settings)
          File "/tmp/pip-build-env-g6o1bpj6/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 338, in get_requires_for_build_wheel
            return self._get_build_requires(config_settings, requirements=['wheel'])
          File "/tmp/pip-build-env-g6o1bpj6/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 320, in _get_build_requires
            self.run_setup()
          File "/tmp/pip-build-env-g6o1bpj6/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 482, in run_setup
            super(_BuildMetaLegacyBackend,
          File "/tmp/pip-build-env-g6o1bpj6/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 335, in run_setup
            exec(code, locals())
          File "<string>", line 11, in <module>
          File "/tmp/pip-req-build-dug1txav/setupext.py", line 26, in register_pth_hook
            source = inspect.getsource(func)
          File "/usr/local/lib/python3.10/inspect.py", line 1147, in getsource
            lines, lnum = getsourcelines(object)
          File "/usr/local/lib/python3.10/inspect.py", line 1129, in getsourcelines
            lines, lnum = findsource(object)
          File "/usr/local/lib/python3.10/inspect.py", line 958, in findsource
            raise OSError('could not get source code')
        OSError: could not get source code
        [end of output]

    note: This error originates from a subprocess, and is likely not a problem with pip.
  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> See above for output.

  note: This error originates from a subprocess, and is likely not a problem with pip.


  at /usr/local/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.

But, I used 1.1.15 and the installation was successful.

root@8609a1ddf268:~/test# poetry add mplcursors
Creating virtualenv test-DVdBw2hf-py3.10 in /root/.cache/pypoetry/virtualenvs
Using version ^0.5.1 for mplcursors

Updating dependencies
Resolving dependencies... (9.6s)

Writing lock file

Package operations: 13 installs, 0 updates, 0 removals

  • Installing pyparsing (3.0.9)
  • Installing packaging (21.3)
  • Installing six (1.16.0)
  • Installing tomli (2.0.1)
  • Installing cycler (0.11.0)
  • Installing fonttools (4.37.1)
  • Installing kiwisolver (1.4.4)
  • Installing numpy (1.23.2)
  • Installing pillow (9.2.0)
  • Installing python-dateutil (2.8.2)
  • Installing setuptools-scm (6.4.2)
  • Installing matplotlib (3.5.3)
  • Installing mplcursors (0.5.1)
root@8609a1ddf268:~/test#
@ijufumi ijufumi added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Sep 5, 2022
@neersighted neersighted added kind/question User questions (candidates for conversion to discussion) status/external-issue Issue is caused by external project (platform, dep, etc) and removed kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Sep 5, 2022
@neersighted
Copy link
Member

neersighted commented Sep 5, 2022

$ docker run --rm -it --entrypoint /bin/bash python:3.10
$ pip install --no-deps --no-binary :all: --use-pep517 mplcursors
Collecting mplcursors
  Downloading mplcursors-0.5.1.tar.gz (88 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 88.3/88.3 kB 3.5 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [25 lines of output]
      Traceback (most recent call last):
        File "/usr/local/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
          main()
        File "/usr/local/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/usr/local/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 130, in get_requires_for_build_wheel
          return hook(config_settings)
        File "/tmp/pip-build-env-un2wgcon/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 338, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
        File "/tmp/pip-build-env-un2wgcon/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 320, in _get_build_requires
          self.run_setup()
        File "/tmp/pip-build-env-un2wgcon/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 482, in run_setup
          super(_BuildMetaLegacyBackend,
        File "/tmp/pip-build-env-un2wgcon/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 335, in run_setup
          exec(code, locals())
        File "<string>", line 11, in <module>
        File "/tmp/pip-install-d_0ucie6/mplcursors_d2842335a4d3476ea6b24c57356662e1/setupext.py", line 26, in register_pth_hook
          source = inspect.getsource(func)
        File "/usr/local/lib/python3.10/inspect.py", line 1147, in getsource
          lines, lnum = getsourcelines(object)
        File "/usr/local/lib/python3.10/inspect.py", line 1129, in getsourcelines
          lines, lnum = findsource(object)
        File "/usr/local/lib/python3.10/inspect.py", line 958, in findsource
          raise OSError('could not get source code')
      OSError: could not get source code
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

Looks like this is an issue with mplcursors -- the setup.py is unable to build in a PEP 517 environment. Poetry will be able to install a wheel if one is uploaded to PyPI (there are none at https://pypi.org/project/mplcursors/#files), or if the project makes a new release with a setup.py that builds properly, Poetry will be able to build and install the sdist.

Note that while Poetry is opting in to PEP 517, pip will make this the default very soon -- so this really needs to be solved in mplcursors.

@adelaharpe
Copy link

$ docker run --rm -it --entrypoint /bin/bash python:3.10
$ pip install --no-deps --no-binary :all: --use-pep517 mplcursors
Collecting mplcursors
  Downloading mplcursors-0.5.1.tar.gz (88 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 88.3/88.3 kB 3.5 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [25 lines of output]
      Traceback (most recent call last):
        File "/usr/local/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
          main()
        File "/usr/local/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/usr/local/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 130, in get_requires_for_build_wheel
          return hook(config_settings)
        File "/tmp/pip-build-env-un2wgcon/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 338, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
        File "/tmp/pip-build-env-un2wgcon/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 320, in _get_build_requires
          self.run_setup()
        File "/tmp/pip-build-env-un2wgcon/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 482, in run_setup
          super(_BuildMetaLegacyBackend,
        File "/tmp/pip-build-env-un2wgcon/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 335, in run_setup
          exec(code, locals())
        File "<string>", line 11, in <module>
        File "/tmp/pip-install-d_0ucie6/mplcursors_d2842335a4d3476ea6b24c57356662e1/setupext.py", line 26, in register_pth_hook
          source = inspect.getsource(func)
        File "/usr/local/lib/python3.10/inspect.py", line 1147, in getsource
          lines, lnum = getsourcelines(object)
        File "/usr/local/lib/python3.10/inspect.py", line 1129, in getsourcelines
          lines, lnum = findsource(object)
        File "/usr/local/lib/python3.10/inspect.py", line 958, in findsource
          raise OSError('could not get source code')
      OSError: could not get source code
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

Looks like this is an issue with mplcursors -- the setup.py is unable to build in a PEP 517 environment. Poetry will be able to install a wheel if one is uploaded to PyPI (there are none at https://pypi.org/project/mplcursors/#files), or if the project makes a new release with a setup.py that builds properly, Poetry will be able to build and install the sdist.

Note that while Poetry is opting in to PEP 517, pip will make this the default very soon -- so this really needs to be solved in mplcursors.

But as the same command works for poetry 1.1.15, does this means that poetry 1.2.1 forces the use of the --use-pep517 flag and poetry 1.1.15 did not?

Copy link

github-actions bot commented Mar 1, 2024

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 Mar 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/question User questions (candidates for conversion to discussion) status/external-issue Issue is caused by external project (platform, dep, etc)
Projects
None yet
Development

No branches or pull requests

3 participants