Daniel SH
Daniel SH

Reputation: 143

Installing Ansible on Windows

I'm trying to install Ansible on a Win10 machine.

I've followed the guidance to install cygwin with the required packages: https://ericsysmin.com/2016/07/28/install-ansible-on-windows/

When I run pip install ansible, I receive the below error:

building 'Crypto.Random.OSRNG.winrandom' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools

The thing is that I have Microsoft Visual C++ 14.0 installed. When checking Programs and Features, it lists Microsoft Visual C++ 2015 Redistributable (x64) - 14.0.23026.

Any idea what's going on, and why isn't my C++ 14.0 install recognized? I'm running pip as administrator, tried both from within the cygwin terminal and regular PowerShell.

Upvotes: 2

Views: 3204

Answers (3)

nthieling
nthieling

Reputation: 356

Windows 10 users at or beyond the Anniversary update should now leverage the Windows Subsystem for Linux (WSL) which is a fully-working Ubuntu (more distros soon) environment within your Windows 10 environment.

You can "natively" install Ansible in that environment with

add-apt-repository ppa:ansible/ansible
apt-get update
apt-get install ansible

Upvotes: 1

gavenkoa
gavenkoa

Reputation: 48883

If you like to have ansible in Cygwin...

Add pre-packaged dependencies::

apt-cyg install curl autoconf automake binutils gcc-core gcc-g++ bcrypt openssh openssl openssl-devel libffi-devel
apt-cyg install python2-pip python2-devel python2-pyasn1 python2-openssl python2-yaml
apt-cyg install python2-paramiko python2-cryptography python2-jinja2 python2-setuptools python2-enum34 python2-idna python2-cffi python2-six
apt-cyg install python2-ipaddress python2-asn1crypto python2-packaging python2-markupsafe python2-appdirs python2-pycparser python2-pyparsing

Install ansible by pip::

pip2 install ansible

Following packages will be compiled from pypi as they are missing in Cygwin::

pycrypto
ecdsa
pynacl

To prevent fork issues close every Cygwin apps and run from ash::

/usr/bin/rebaseall -v

Upvotes: 0

Daniel SH
Daniel SH

Reputation: 143

After some research I found that a potential problem can be if I have the 32-bit version of Python installed.

After uninstalling the existing version, and installing the 64-bit version, I had to remove the existing 64-bit Visual C++ Redistributable 14.0, too, but after that I could successfully install the Visual C++ Build Tools, and that solved the problem.

Now I have another problem, the installer complains about a syntax error in one of the modules, but that's out of scope for this question.

Upvotes: 2

Related Questions