Hello everyone,
I am facing an issue in creating Windows executable (.exe) from a Python Script that uses SynapseClient. 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. When I tried 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
File "", line 2237, in _find_and_load
File "", line 2226, in _find_and_load_unlocked
File "", line 1191, in _load_unlocked
File "", 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
__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
Created by Sumanta Seal sumanta_asl Hi Larsson,
Thank you for your quick response. Can you please suggest any of such packaging tools that will work with SynapseClient?
Thanks,
Sumanta Hi @sumanta_asl
Thank you for your inquiry. I haven't personally had experience with using py2exe but it looks like the path that is being used synapseclient\synapsePythonClient is wrong. The path that the client gets installed into is usually synapseclient/synapseclient.
Considering my lack of experience with Py2exe it might be worth posting to the py2exe [mailing list](https://lists.sourceforge.net/lists/listinfo/py2exe-users). Or perhaps there is someone else on this board with more experience.
Drop files to upload
Error in packaging (windows exe) Python script with SynapseClient page is loading…