jborean93 / pypsrp

PowerShell Remoting Protocol for Python
MIT License
324 stars 49 forks source link

Getting a BackendUnavailable upon pip install #152

Closed nodje closed 2 years ago

nodje commented 2 years ago

Hi,

for some reason, I'm getting this error when attempting a pip install pypsrp:

 Installing build dependencies ... done
  Getting requirements to build wheel ... done
ERROR: Exception:
Traceback (most recent call last):
  File "/var/lib/awx/venv/ansible/lib/python2.7/site-packages/pip/_internal/cli/base_command.py", line 223, in _main
    status = self.run(options, args)
  File "/var/lib/awx/venv/ansible/lib/python2.7/site-packages/pip/_internal/cli/req_command.py", line 180, in wrapper
    return func(self, options, args)
  File "/var/lib/awx/venv/ansible/lib/python2.7/site-packages/pip/_internal/commands/install.py", line 321, in run
    reqs, check_supported_wheels=not options.target_dir
  File "/var/lib/awx/venv/ansible/lib/python2.7/site-packages/pip/_internal/resolution/legacy/resolver.py", line 180, in resolve
    discovered_reqs.extend(self._resolve_one(requirement_set, req))
  File "/var/lib/awx/venv/ansible/lib/python2.7/site-packages/pip/_internal/resolution/legacy/resolver.py", line 385, in _resolve_one
    dist = self._get_dist_for(req_to_install)
  File "/var/lib/awx/venv/ansible/lib/python2.7/site-packages/pip/_internal/resolution/legacy/resolver.py", line 337, in _get_dist_for
    dist = self.preparer.prepare_linked_requirement(req)
  File "/var/lib/awx/venv/ansible/lib/python2.7/site-packages/pip/_internal/operations/prepare.py", line 480, in prepare_linked_requirement
    return self._prepare_linked_requirement(req, parallel_builds)
  File "/var/lib/awx/venv/ansible/lib/python2.7/site-packages/pip/_internal/operations/prepare.py", line 524, in _prepare_linked_requirement
    req, self.req_tracker, self.finder, self.build_isolation,
  File "/var/lib/awx/venv/ansible/lib/python2.7/site-packages/pip/_internal/operations/prepare.py", line 88, in _get_prepared_distribution
    abstract_dist.prepare_distribution_metadata(finder, build_isolation)
  File "/var/lib/awx/venv/ansible/lib/python2.7/site-packages/pip/_internal/distributions/sdist.py", line 39, in prepare_distribution_metadata
    self._setup_isolation(finder)
  File "/var/lib/awx/venv/ansible/lib/python2.7/site-packages/pip/_internal/distributions/sdist.py", line 97, in _setup_isolation
    reqs = backend.get_requires_for_build_wheel()
  File "/var/lib/awx/venv/ansible/lib/python2.7/site-packages/pip/_vendor/pep517/wrappers.py", line 178, in get_requires_for_build_wheel
    'config_settings': config_settings
  File "/var/lib/awx/venv/ansible/lib/python2.7/site-packages/pip/_vendor/pep517/wrappers.py", line 284, in _call_hook
    raise BackendUnavailable(data.get('traceback', ''))
BackendUnavailable

I suppose some dependencies are missing. I'm running this on a RHEL7 machine. I've made sure gcc is installed.

Looking at the Requirements documentation, it seems only python package dependencies are required, which should be automatically installed by pip.

Is there any other system dependency that'd be necessary?

Python packages asyncssh, pykrb5 are not installed in the venv but gssapi and psutil are. AFAIU this would not trigger the kerberos or any other specific feature that require more system dependencies. But maybe I'm mistaken here.

jborean93 commented 2 years ago

The traceback indicates you are using Python 2.7 which hasn't been supported since v0.5.0 as it was dropped in v0.6.0 https://github.com/jborean93/pypsrp/blob/master/CHANGELOG.md#060---2021-10-21. The error you have is a problem with pip though, it's trying to do something with sdist but the backend isn't available for some reason. Why that is I'm not sure but I recommend you upgrade pip, setuptools, and wheel to the latest version available for Python 2.7 and try again.

You should probably try and start using Python 3.x as well. Red Hat even offers a Python 3 install through their software collections on RHEL 7 https://developers.redhat.com/blog/2018/08/13/install-python3-rhel.

nodje commented 2 years ago

Thanks for your answer! Indeed, Ansible Tower virtual envs are still using python 2.8.5. pip setuptools were already upgraded to the latest but not wheels.

I made sure it was and now I can compile 0.8.1 even with python 2.7.5. But if 0.8.1 is not Python2 compatible I suppose I won't risk getting runtime errors

Cheers