So my Web Scrapper works fine when ran with IDLE/Python, but when I compile it into a single .exe file (using py2exe), it raises an IOError.
When using urllib module:
IOError: [Errno url error] unknown url type: 'https'
When using requests module:
requests.exceptions.SSLError: Can't connect to HTTPS URL because the SSL module is not available.
I did notice, when compiling with py2exe, it said at the end that several "modules appear to be missing", including a OpenSSL.SSL, and several references to urllib, which might be the problem?
Any ideas, solutions...?
Can you check if you have openssl installed on your Windows machine? openssl is an open source cryptographic library which is used by most *nix systems. I believe that requests and urllib uses the same underlying library.
Once you fix this and then compile, I'm hoping the errors go away.
Note: I am not fully familiar with how you can do it and I do not own a Windows machine to test some of the articles I found via Google search.
try this out set "skip_archive": True,"unbuffered": True
setup(
version = "1.0",
name = "MyApplication",
url = "http://www.example.com",
author = "yourname",
author_email = "[email protected]",
license = "https://www.binpress.com/license/",
copyright = 'Copyright (c) 2017 MyApplication',
windows=[{'script': "yourfile.py","icon_resources": [(0, "youricon.ico")],'copyright': "Copyright (c) 2017 MyApplication"}] ,options={'py2exe':{"skip_archive": True,"unbuffered": True,'packages':['Tkinter','PIL','sip','pyavrophonetic','speech_recognition','simplejson','tkSimpleDialog','tkFileDialog','io','tkMessageBox','Tkconstants','random','pyaudio','os','wave','pocketsphinx','sphinxbase','pyttsx']}}
)
#name your reqired modules
then carefully copy paste the files said missing manually to under dist directory and other files under their respective directory as you can find some files missing under modules. Then make an installer for your exe using Inno Setup. Hope this helps.
EDIT
You can find extra installed modules in location likeD:\Python\Lib\site-packages and most of python's own modules in D:\Python\Lib
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With