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

Install fails due to "pip" or "setuptools" import in setup.py #6421

Closed
3 tasks done
jdb78 opened this issue Sep 6, 2022 · 3 comments
Closed
3 tasks done

Install fails due to "pip" or "setuptools" import in setup.py #6421

jdb78 opened this issue Sep 6, 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

@jdb78
Copy link

jdb78 commented Sep 6, 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).
  • Same error on Windows 10, Amazon Linux 2, and Ubuntu:
  • Poetry version 1.2.0:
  • Link of a Gist with the contents of your pyproject.toml file:

Issue

Adding "pandoc" to dependencies leads to an install error via poetry. Installing via "pip" directly succeeds:

  Command ['/home/ec2-user/environment/.../.venv/bin/python', '/home/ec2-user/.local/share/pypoetry/venv/lib64/python3.7/site-packages/virtualenv/seed/wheels/embed/pip-22.2.2-py3-none-any.whl/pip', 'install', '--use-pep517', '--disable-pip-version-check', '--prefix', '/home/ec2-user/environment/.../.venv', '--no-deps', '/home/ec2-user/.cache/pypoetry/artifacts/68/1b/01/40e9b347306cf5956f2b25567dc3206a72ec9e77eb0da7eb26dca212e4/pandoc-2.2.tar.gz'] errored with the following return code 1, and output: 
  Processing /home/ec2-user/.cache/pypoetry/artifacts/68/1b/01/40e9b347306cf5956f2b25567dc3206a72ec9e77eb0da7eb26dca212e4/pandoc-2.2.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
    ╰─> [23 lines of output]
        Traceback (most recent call last):
          File "<string>", line 7, in <module>
        ModuleNotFoundError: No module named 'pip'
        
        During handling of the above exception, another exception occurred:
        
        Traceback (most recent call last):
          File "/tmp/tmpzve1wlyp_in_process.py", line 363, in <module>
            main()
          File "/tmp/tmpzve1wlyp_in_process.py", line 345, in main
            json_out['return_val'] = hook(**hook_input['kwargs'])
          File "/tmp/tmpzve1wlyp_in_process.py", line 130, in get_requires_for_build_wheel
            return hook(config_settings)
          File "/tmp/pip-build-env-8w54ypyd/overlay/lib/python3.9/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-8w54ypyd/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 320, in _get_build_requires
            self.run_setup()
          File "/tmp/pip-build-env-8w54ypyd/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 482, in run_setup
            super(_BuildMetaLegacyBackend,
          File "/tmp/pip-build-env-8w54ypyd/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 335, in run_setup
            exec(code, locals())
          File "<string>", line 12, in <module>
        ImportError: pip is not installed, refer to <http://pip.readthedocs.org> for instructions.
        [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 ~/.local/share/pypoetry/venv/lib64/python3.7/site-packages/poetry/utils/env.py:1473 in _run
      1469│                 output = subprocess.check_output(
      1470│                     command, stderr=subprocess.STDOUT, env=env, **kwargs
      1471│                 )
      1472│         except CalledProcessError as e:
    → 1473│             raise EnvCommandError(e, input=input_)
      1474│ 
      1475│         return decode(output)
      1476│ 
      1477│     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/ec2-user/.cache/pypoetry/artifacts/68/1b/01/40e9b347306cf5956f2b25567dc3206a72ec9e77eb0da7eb26dca212e4/pandoc-2.2.tar.gz

  at ~/.local/share/pypoetry/venv/lib64/python3.7/site-packages/poetry/utils/pip.py:51 in pip_install
       47│ 
       48│     try:
       49│         return environment.run_pip(*args)
       50│     except EnvCommandError as e:
    →  51│         raise PoetryException(f"Failed to install {path.as_posix()}") from e

In pandoc's setup.py file (https://github.com/boisgera/pandoc/blob/master/setup.py), the section

try:
    import pip
    import setuptools
except ImportError:
    url = "http://pip.readthedocs.org"
    error = f"pip is not installed, refer to <{url}> for instructions."
    raise ImportError(error)

seems to be responsible for the fail. Somehow "pip" or "setuptools" is not available.

@jdb78 jdb78 added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Sep 6, 2022
@dimbleby
Copy link
Contributor

dimbleby commented Sep 6, 2022

this needs to be solved at pandoc

boisgera/pandoc#49 seems to say that it has come up before, but the maintainer hasn't gotten round to resolving it yet.

@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 6, 2022
@neersighted
Copy link
Member

See #6407 for a similar case, as well as some workarounds that you can perform as the end user.

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