Unable to install pyOpenSSL
<p>I dual booted a Windows 10 partition on a Macbook Pro:
Mac: El Capitan (64-bit)
Windows: Windows 10 64-bit, formatted with the fat file system</p>

<p>On Windows, I installed cygwin and Python 2.7. Through cygwin, I installed pip and gcc.</p>

<p>I also tried installing cffi with <a href="http://www.lfd.uci.edu/~gohlke/pythonlibs/#cffi" rel="nofollow">http://www.lfd.uci.edu/~gohlke/pythonlibs/#cffi</a>, but when I ran pip install <code>cffi-1.8.2-cp27-cp27m-win_amd64.whl</code>, I got the error: <code>cffi....whl is not supported on this platform</code>. Then I tried many things I can't remember, I think I even tried downloading a tar file, and then now, when I run pip install cffi, I'm told it's already installed.</p>

<p>I then ran <code>pip install pyOpenSSL</code>,however, I got this error:</p>

<pre><code> gcc -fno-strict-aliasing -ggdb -O2 -pipe -Wimplicit-function-declaration -fdebug-prefix-map=/usr/src/ports/python/python-2.7.10-1.x86_64/build=/usr/src/debug/python-2.7.10-1 -fdebug-prefix-map=/usr/src/ports/python/python-2.7.10-1.x86_64/src/Python-2.7.10=/usr/src/debug/python-2.7.10-1 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/usr/include/python2.7 -c build/temp.cygwin-2.6.0-x86_64-2.7/_openssl.c -o build/temp.cygwin-2.6.0-x86_64-2.7/build/temp.cygwin-2.6.0-x86_64-2.7/_openssl.o
    build/temp.cygwin-2.6.0-x86_64-2.7/_openssl.c:433:30: fatal error: openssl/opensslv.h: No such file or directory
    compilation terminated.
    error: command 'gcc' failed with exit status 1

Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-9Emw8c/cryptography/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-wy64bj-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-9Emw8c/cryptography/
</code></pre>

<p>I also got this error when I did <code>pip install cryptography</code>.</p>

<p>I read somewhere that I should try: <code>pip install --global-option build_ext --global-option --compiler=mingw64 pyopenssl</code>, and I got:</p>

<pre><code>Skipping bdist_wheel for pyopenssl, due to binaries being disabled for it.
Skipping bdist_wheel for cryptography, due to binaries being disabled for it.
Installing collected packages: cryptography, pyopenssl
  Running setup.py install for cryptography ... error
    Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-fIb1xc/cryptography/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" build_ext --compiler=mingw64 install --record /tmp/pip-7flSlN-record/install-record.txt --single-version-externally-managed --compile:
    running build_ext
    generating cffi module 'build/temp.cygwin-2.6.0-x86_64-2.7/_padding.c'
    creating build
    creating build/temp.cygwin-2.6.0-x86_64-2.7
    generating cffi module 'build/temp.cygwin-2.6.0-x86_64-2.7/_constant_time.c'
    generating cffi module 'build/temp.cygwin-2.6.0-x86_64-2.7/_openssl.c'
    error: don't know how to compile C/C++ code on platform 'posix' with 'mingw64' compiler

    ----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-fIb1xc/cryptography/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" build_ext --compiler=mingw64 install --record /tmp/pip-7flSlN-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-fIb1xc/cryptography/
</code></pre>

<p>Can someone please advise what's wrong??</p>

<p>Update: After installing <code>mingw64x86_64-openssl: OpenSSL encryption library for Win64 toolchain</code> through cygwin, and running <code>pip install pyopenssl</code>, I got:</p>

<pre><code> running build_ext
    generating cffi module 'build/temp.cygwin-2.6.0-x86_64-2.7/_padding.c'
    creating build/temp.cygwin-2.6.0-x86_64-2.7
    generating cffi module 'build/temp.cygwin-2.6.0-x86_64-2.7/_constant_time.c'
    generating cffi module 'build/temp.cygwin-2.6.0-x86_64-2.7/_openssl.c'
    building '_openssl' extension
    creating build/temp.cygwin-2.6.0-x86_64-2.7/build
    creating build/temp.cygwin-2.6.0-x86_64-2.7/build/temp.cygwin-2.6.0-x86_64-2.7
    /usr/bin/clang -fno-strict-aliasing -ggdb -O2 -pipe -Wimplicit-function-declaration -fdebug-prefix-map=/usr/src/ports/python/python-2.7.10-1.x86_64/build=/usr/src/debug/python-2.7.10-1 -fdebug-prefix-map=/usr/src/ports/python/python-2.7.10-1.x86_64/src/Python-2.7.10=/usr/src/debug/python-2.7.10-1 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/usr/include/python2.7 -c build/temp.cygwin-2.6.0-x86_64-2.7/_openssl.c -o build/temp.cygwin-2.6.0-x86_64-2.7/build/temp.cygwin-2.6.0-x86_64-2.7/_openssl.o
    build/temp.cygwin-2.6.0-x86_64-2.7/_openssl.c:433:10: fatal error: 'openssl/opensslv.h' file not found
    #include &lt;openssl/opensslv.h&gt;
             ^
    1 error generated.
    error: command '/usr/bin/clang' failed with exit status 1

    ----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-ZsWN3h/cryptography/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-D2XH0P-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-ZsWN3h/cryptography/
</code></pre>

<p>I had a similar issue and installed the libssl header files so I could compile the python module:</p>

<pre><code>sudo apt-get install libssl-dev
</code></pre>

python windows python-2.7 windows-10 pyopenssl