From: Toni B. <hih...@go...> - 2016-10-03 15:05:29
|
Hi, it seems like synapse client wants to read relevant data from a json file which isn't available when bundled into an exe file. In my eyes it would be inefficient to add some tweaks in py2exe, packing the relevant files and forwarding the necessary reads to this file when importing. Instead I would try contacting the developers of synapse client or file an issue ticket to them so they can try to get this working properly. You can of course try to package the relevant file, which seems to be in some path like synapseclient\synapsepythonclient, into the executable on your own and see if it works like a charm, but I doubt it. I myself don't have any experience with this library, so you should try to get it working on your own or contact the developers as stated above. Hope you get behind the magic of this :). Best Regards. Toni Am 03.10.2016 um 15:20 schrieb Sumanta Seal: > > 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 > > > > ------------------------------------------------------------------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, SlashDot.org! http://sdm.link/slashdot > > > _______________________________________________ > Py2exe-users mailing list > Py2...@li... > https://lists.sourceforge.net/lists/listinfo/py2exe-users |