From: Sumanta S. <sum...@gm...> - 2016-10-03 13:20:53
|
Hello everyone, I am facing an issue in creating Windows executable (.exe) from a Python Script that uses SynapseClient, a python client library provided by Synapse (https://www.synapse.org). I have installed SynapseClient downloading it from git and executing the command "python setup.py install" in the console. I have verified that the new directory "synapseclient-1.5.2.dev1-py3.4.egg" (along with it's sub-directories "EGG-INFO" and "synapseclient") added in the location "Python34\Lib\site-packages". synapseclient library is successfully imported to my Python script and when I ran my script using command "python myScript.pyw" in console, it executed properly without any error. I was able to create windows .exe using py2exe (command, python setup.py py2exe), the exe is generate properly, but when I double-clicked on the generated .exe, it shows the error as - Traceback (most recent call last): File "myScript.pyw", line 18, in <module> File "<frozen importlib.*bootstrap>", line 2237, in *find_and_load File "<frozen importlib.*bootstrap>", line 2226, in *find_and_load_unlocked File "<frozen importlib.*bootstrap>", line 1191, in *load_unlocked File "<frozen importlib.*bootstrap>", line 1161, in * load_backward_compatible File "C:\Python34\lib\site-packages\synapseclient-1.5.2. dev1-py3.4.egg\synapseclient__init__.py", line 325, in <module> *version* = json.loads(pkg_resources.resource_string('synapseclient', 'synapsePythonClient').decode())['latestVersion'] File "C:\Python34\lib\site-packages\pkg_resources__init__.py", line 1183, in resource_string self, resource_name File "C:\Python34\lib\site-packages\pkg_resources__init__.py", line 1623, in get_resource_string return self.*get(self.*fn(self.module_path, resource_name)) File "C:\Python34\lib\site-packages\pkg_resources__init*.py", line 1701, in *get return self.loader.get_data(path) OSError: [Errno 0] Error: 'synapseclient\synapsePythonClient' My setup.py file is as follows - ======================================================= from distutils.core import setup import py2exe EXE = [{'script':'myScript.pyw'}] DATA_FILES = [('css/bootstrap',['css/bootstrap/bootstrap.min.css',' css/bootstrap/bootstrap-theme.min.css']), ('css/font-awesome/css',['css/font-awesome/css/font-awesome. css','css/font-awesome/css/font-awesome.min.css']), ('css/font-awesome/fonts',['css/font-awesome/fonts/ FontAwesome.otf','css/font-awesome/fonts/fontawesome-webfont.eot','css/font- awesome/fonts/fontawesome-webfont.svg','css/font-awesome/fonts/fontawesome- webfont.ttf','css/font-awesome/fonts/fontawesome-webfont.woff','css/font- awesome/fonts/fontawesome-webfont.woff2']), ('js/bootstrap',['js/bootstrap/bootstrap.js','js/ bootstrap/bootstrap.min.js']), ('js/jquery',['js/jquery/jquery.min.js','js/jquery/ jquery.ui.touch-punch.min.js','js/jquery/jquery-ui.min.js']), ('',['myFile.html']) ] OPTIONS = {'py2exe': {'includes': ['PySide.QtWebKit','PySide. QtGui','PySide.QtNetwork']}} GENERATOR = ['py2exe']; setup( windows = EXE, data_files = DATA_FILES, options = OPTIONS, setup_requires = GENERATOR, zipfile = None, ) ========================================== May be I am missing something silly. Is there anything I need to add in my setup.py file ? Please help. Thanks, Sumanta |