Pip subprocess to install build dependencies did not run successfully

Hi

I am trying to install ansible using pip command and getting below error.

pip install ansible

Collecting ansible
  Using cached ansible-11.6.0-py3-none-any.whl.metadata (8.1 kB)
Collecting ansible-core~=2.18.6 (from ansible)
  Using cached ansible_core-2.18.6-py3-none-any.whl.metadata (7.7 kB)
Collecting jinja2>=3.0.0 (from ansible-core~=2.18.6->ansible)
  Using cached jinja2-3.1.6-py3-none-any.whl.metadata (2.9 kB)
Collecting PyYAML>=5.1 (from ansible-core~=2.18.6->ansible)
  Using cached pyyaml-6.0.2.tar.gz (130 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting cryptography (from ansible-core~=2.18.6->ansible)
  Using cached cryptography-45.0.4.tar.gz (744 kB)
  Installing build dependencies ... error
  error: subprocess-exited-with-error

  × pip subprocess to install build dependencies did not run successfully.
  │ exit code: 1
  ╰─> [42 lines of output]
      Collecting maturin<2,>=1.8.6
        Using cached maturin-1.8.7.tar.gz (205 kB)
        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
        ╰─> [21 lines of output]
            Traceback (most recent call last):
              File "/home/bmr/venv/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 389, in <module>
                main()
              File "/home/bmr/venv/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 373, in main
                json_out["return_val"] = hook(**hook_input["kwargs"])
                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
              File "/home/bmr/venv/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 143, in get_requires_for_build_wheel
                return hook(config_settings)
                       ^^^^^^^^^^^^^^^^^^^^^
              File "/tmp/pip-install-4krxxpy7/maturin_a3a9853866494430978cd11a0d956a53/maturin/bootstrap.py", line 29, in get_requires_for_build_wheel
                reqs = _orig_get_requires_for_build_wheel()
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
              File "/tmp/pip-build-env-eqhk87r_/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 331, in get_requires_for_build_wheel
                return self._get_build_requires(config_settings, requirements=[])
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
              File "/tmp/pip-build-env-eqhk87r_/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 301, in _get_build_requires
                self.run_setup()
              File "/tmp/pip-build-env-eqhk87r_/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 317, in run_setup
                exec(code, locals())
              File "<string>", line 52, in <module>
            ModuleNotFoundError: No module named 'puccinialin'
            [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.
      [end of output]

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

× pip subprocess to install build dependencies 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.

How to fix this?

Thanks

Hello,

which operating system are you using (Windows, Linux, Ubuntu, etc.)?

From Ansible documentation website:

[Which modules are available?]

The majority of the core Ansible modules are written for a combination of Unix-like machines and other generic services. As these modules are written in Python and use APIs not present on Windows they will not work.

I am using Solaris machine.

Which command did you use to install it. Your post does not show this.

Due to Ansible’s special installation requirements, I would have a look here as a starting point:

This is the command I have used

pip install ansible

I have mentioned it at the top of the post

Thanks

There is ModuleNotFoundError for puccinialin in the original post.

but I see the package already exist in pip

Package                 Version
----------------------- ---------
puccinialin             0.1.5

I removed it but still same error.

python version
python version - 3.11.10

Can you try upgrading pip, setuptools, and wheels to the latest version.

I think that for a Unix system, the command is:

python3 -m pip install --upgrade pip setuptools wheel

Thanks Paul, it upgraded wheel but others are already latest is the response.

again I get the same error

Does this ONLY happen for this particular package or does this also happen for other packages?

Can you try installing another package as a test (i.e., numpy, pandas, matplotlib, etc.).
This is to test if it is something inherent with your system setup or if it is an issue with ansible in particular.