unable to install pywinrm on Centos 6.5

Hello everyone,

I am facing an issue while installing “pywinrm” for managing my windows host via Ansible, I am getting following errors:

Collecting pywinrm
Using cached pywinrm-0.2.2-py2.py3-none-any.whl
Requirement already satisfied: requests>=2.9.1 in /usr/lib/python2.6/site-packages (from pywinrm)
Requirement already satisfied: xmltodict in /usr/lib/python2.6/site-packages (from pywinrm)
Requirement already satisfied: six in /usr/lib/python2.6/site-packages (from pywinrm)
Collecting requests-ntlm>=0.3.0 (from pywinrm)
Using cached requests_ntlm-1.1.0-py2.py3-none-any.whl
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /usr/lib/python2.6/site-packages (from requests>=2.9.1->pywinrm)
Requirement already satisfied: certifi>=2017.4.17 in /usr/lib/python2.6/site-packages (from requests>=2.9.1->pywinrm)
Requirement already satisfied: urllib3<1.23,>=1.21.1 in /usr/lib/python2.6/site-packages (from requests>=2.9.1->pywinrm)
Requirement already satisfied: idna<2.7,>=2.5 in /usr/lib/python2.6/site-packages (from requests>=2.9.1->pywinrm)
Collecting cryptography>=1.3 (from requests-ntlm>=0.3.0->pywinrm)
Using cached cryptography-2.1.4.tar.gz
Requirement already satisfied: ntlm-auth>=1.0.2 in /usr/lib/python2.6/site-packages (from requests-ntlm>=0.3.0->pywinrm)
Requirement already satisfied: asn1crypto>=0.21.0 in /usr/lib/python2.6/site-packages (from cryptography>=1.3->requests-ntlm>=0.3.0->pywinrm)
Requirement already satisfied: enum34 in /usr/lib/python2.6/site-packages (from cryptography>=1.3->requests-ntlm>=0.3.0->pywinrm)
Requirement already satisfied: ipaddress in /usr/lib/python2.6/site-packages (from cryptography>=1.3->requests-ntlm>=0.3.0->pywinrm)
Collecting cffi>=1.7 (from cryptography>=1.3->requests-ntlm>=0.3.0->pywinrm)
/usr/lib/python2.6/site-packages/pip/vendor/requests/packages/urllib3/util/ssl.py:318: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#snimissingwarning.
SNIMissingWarning
/usr/lib/python2.6/site-packages/pip/vendor/requests/packages/urllib3/util/ssl.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
Downloading cffi-1.11.2-cp26-cp26mu-manylinux1_x86_64.whl (405kB)
100% |████████████████████████████████| 409kB 217kB/s
Requirement already satisfied: ordereddict; python_version < “2.7” in /usr/lib64/python2.6/site-packages (from ntlm-auth>=1.0.2->requests-ntlm>=0.3.0->pywinrm)
Requirement already satisfied: pycparser in /usr/lib/python2.6/site-packages (from cffi>=1.7->cryptography>=1.3->requests-ntlm>=0.3.0->pywinrm)
Installing collected packages: cffi, cryptography, requests-ntlm, pywinrm
Running setup.py install for cryptography … error
Complete output from command /usr/bin/python -u -c “import setuptools, tokenize;file=‘/tmp/pip-build-PX7Lla/cryptography/setup.py’;f=getattr(tokenize, ‘open’, open)(file);code=f.read().replace(‘\r\n’, ‘\n’);f.close();exec(compile(code, file, ‘exec’))” install --record /tmp/pip-daX7T4-record/install-record.txt --single-version-externally-managed --compile:
Couldn’t find index page for ‘cffi’ (maybe misspelled?)
No local packages or download links found for cffi>=1.7
Traceback (most recent call last):
File “”, line 1, in
File “/tmp/pip-build-PX7Lla/cryptography/setup.py”, line 307, in
**keywords_with_side_effects(sys.argv)
File “/usr/lib64/python2.6/distutils/core.py”, line 113, in setup
_setup_distribution = dist = klass(attrs)
File “/usr/lib/python2.6/site-packages/setuptools/dist.py”, line 221, in init
self.fetch_build_eggs(attrs.pop(‘setup_requires’))
File “/usr/lib/python2.6/site-packages/setuptools/dist.py”, line 245, in fetch_build_eggs
parse_requirements(requires), installer=self.fetch_build_egg
File “/usr/lib/python2.6/site-packages/pkg_resources.py”, line 538, in resolve
dist = best[req.key] = env.best_match(req, self, installer)
File “/usr/lib/python2.6/site-packages/pkg_resources.py”, line 780, in best_match
return self.obtain(req, installer) # try and download/install
File “/usr/lib/python2.6/site-packages/pkg_resources.py”, line 792, in obtain
return installer(requirement)
File “/usr/lib/python2.6/site-packages/setuptools/dist.py”, line 293, in fetch_build_egg
return cmd.easy_install(req)
File “/usr/lib/python2.6/site-packages/setuptools/command/easy_install.py”, line 466, in easy_install
raise DistutilsError(msg)
distutils.errors.DistutilsError: Could not find suitable distribution for Requirement.parse(‘cffi>=1.7’)

Looks like it wants a newer version of cffi.

What happens if you install cffi first?

I recall having some trouble getting cryptography installed when I was using Centos 6.5, but forget the details now. I think maybe I had to use yum to remove the version supplied with the OS. Things have probably moved on but my guess would be you have some conflict between the python libraries installed with the OS and the ones that are coming from pip. I would probably try uninstalling things from yum that were older versions and then having another go at the pip install (but not if the machine is doing something critical of course)

Hope this helps,

Jon

I had the same issue with my RHEL6.4. The woraround I followed was to upgrade python on my system to 3.6. THen the installation of pywinrm went fine.

Than you for your quick response and apologies for replying late.

Thank you Selva Kumar, It worked after following your steps. I have reinstalled Ansible using pip3.6