Hey Guys -
I'm really frustrated. I've got a small python-run app which I'm trying to enable SSL on. After enabling SSL, I try to start the app via it's py file and it fails. Logs show the following:
raise ImportError("You must install pyOpenSSL to use HTTPS.")
ImportError: You must install pyOpenSSL to use HTTPS.
So... I already have Python 2.7 installed (in C:\Python27) but now must install pyOpenSSL. No matter what I try, I can't get it to install. Below is what I've tried so far without luck...
#1 - Tried installing pyOpenSSL via command line
I downloaded the entire pyOpenSSL package from Github
, extracted to a folder in my Python folder, and ran the command "python setup.py install --user". After a few seconds, I get the error "error: Setup script exited with error: Unable to find vcvarsall.bat"
Note: The entire log from the install attempt is at the end of this post
#2 - Trying to fix vcvarsall.bat error
I found many references to fixing it online so started trying things...
First, I read Setup Tools needed to be installed. I installed it for Winx32 (since my Python's x32) but no change. It was installed via an MSI named "setuptools-5.8.win32-py2.
Next, I found a post saying
it was due to Visual Studio 2010 issues. I ended up installing Visual Studio 2010 Express (which I didn't want to do), adding an environment variable (which I tested to work), plus editing a couple of lines in msvc9compiler.py. After all of this - same error :(
I finally found an MSI package
at eGenix which a post said would allow me to install pyOpenSSL witout having to compile it. I got the Winx32 version for Python 2.7, installed it, then tried opening my Python app again. No change!
I was going to go ahead and uninstall VBSE, but don't know if I'll still need it for a fix. I've already wasted 2 hours on this. My system specs are below:
- Intel i7 / 16gb RAM
- Windows 8.1 Update 1 x64 (Fully Patched)
- Python 2.7 installed to C:\Python27
(I used version 2.7 instead of 3 as I read for the app I use it for, 2.x had less issues)
Any help would be appreciated!
Complete Log from pyOpenSSL Install Attempt (After making changes to msvc9compiler.py listed in link above)
C:\Python27\pyopenssl>python setup.py install --user
writing requirements to pyOpenSSL.egg-info\requires.txt
writing top-level names to pyOpenSSL.egg-info\top_level.txt
writing dependency_links to pyOpenSSL.egg-info\dependency_links.txt
reading manifest file 'pyOpenSSL.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'README'
warning: no previously-included files matching '*.pyc' found anywhere in distribution
no previously-included directories found matching 'doc\_build'
writing manifest file 'pyOpenSSL.egg-info\SOURCES.txt'
installing library code to build\bdist.win32\egg
copying build\lib\OpenSSL\crypto.py -> build\bdist.win32\egg\OpenSSL
copying build\lib\OpenSSL\rand.py -> build\bdist.win32\egg\OpenSSL
copying build\lib\OpenSSL\SSL.py -> build\bdist.win32\egg\OpenSSL
copying build\lib\OpenSSL\test\test_crypto.py -> build\bdist.win32\egg\OpenSSL\test
copying build\lib\OpenSSL\test\test_rand.py -> build\bdist.win32\egg\OpenSSL\test
copying build\lib\OpenSSL\test\test_ssl.py -> build\bdist.win32\egg\OpenSSL\test
copying build\lib\OpenSSL\test\util.py -> build\bdist.win32\egg\OpenSSL\test
copying build\lib\OpenSSL\test\__init__.py -> build\bdist.win32\egg\OpenSSL\test
copying build\lib\OpenSSL\tsafe.py -> build\bdist.win32\egg\OpenSSL
copying build\lib\OpenSSL\version.py -> build\bdist.win32\egg\OpenSSL
copying build\lib\OpenSSL\_util.py -> build\bdist.win32\egg\OpenSSL
copying build\lib\OpenSSL\__init__.py -> build\bdist.win32\egg\OpenSSL
byte-compiling build\bdist.win32\egg\OpenSSL\crypto.py to crypto.pyc
byte-compiling build\bdist.win32\egg\OpenSSL\rand.py to rand.pyc
byte-compiling build\bdist.win32\egg\OpenSSL\SSL.py to SSL.pyc
byte-compiling build\bdist.win32\egg\OpenSSL\test\test_crypto.py to test_crypto.pyc
byte-compiling build\bdist.win32\egg\OpenSSL\test\test_rand.py to test_rand.pyc
byte-compiling build\bdist.win32\egg\OpenSSL\test\test_ssl.py to test_ssl.pyc
byte-compiling build\bdist.win32\egg\OpenSSL\test\util.py to util.pyc
byte-compiling build\bdist.win32\egg\OpenSSL\test\__init__.py to __init__.pyc
byte-compiling build\bdist.win32\egg\OpenSSL\tsafe.py to tsafe.pyc
byte-compiling build\bdist.win32\egg\OpenSSL\version.py to version.pyc
byte-compiling build\bdist.win32\egg\OpenSSL\_util.py to _util.pyc
byte-compiling build\bdist.win32\egg\OpenSSL\__init__.py to __init__.pyc
copying pyOpenSSL.egg-info\PKG-INFO -> build\bdist.win32\egg\EGG-INFO
copying pyOpenSSL.egg-info\SOURCES.txt -> build\bdist.win32\egg\EGG-INFO
copying pyOpenSSL.egg-info\dependency_links.txt -> build\bdist.win32\egg\EGG-INFO
copying pyOpenSSL.egg-info\requires.txt -> build\bdist.win32\egg\EGG-INFO
copying pyOpenSSL.egg-info\top_level.txt -> build\bdist.win32\egg\EGG-INFO
zip_safe flag not set; analyzing archive contents...
creating 'dist\pyOpenSSL-0.14-py2.7.egg' and adding 'build\bdist.win32\egg' to it
removing 'build\bdist.win32\egg' (and everything under it)
Copying pyOpenSSL-0.14-py2.7.egg to c:\users\kelnet\appdata\roaming\python\python27\site-packages
pyOpenSSL 0.14 is already the active version in easy-install.pth
Processing dependencies for pyOpenSSL==0.14
Searching for cryptography>=0.5.4
Reading https://pypi.python.org/simple/cryptography/Best match: cryptography 0.6
Running cryptography-0.6\setup.py -q bdist_egg --dist-dir c:\users\kelnet\appdata\local\temp\easy_install-vnfpqa\cryptography-0.6\egg-dist-tmp-m31wio
Searching for cffi>=0.8
Best match: cffi 0.8.6
Running cffi-0.8.6\setup.py -q bdist_egg --dist-dir c:\users\kelnet\appdata\local\temp\easy_install-vnfpqa\cryptography-0.6\temp\easy_install-c6fwwn\cffi-0.8.6\egg-dist-tmp-7fi7og
error: Setup script exited with error: Unable to find vcvarsall.bat