Closed maxslimmer closed 8 years ago
Hi maxslimmer, are you using esky from pypi? Are you using python 2 or python3?
Sorry, here's my environment: CPython 2.7.10 Same behavior with esky 0.9.8 and 0.9.9 (yes from pypi) pythonnet 2.1.0.dev1 py2exe 0.6.9 pywin32 219 Windows 7
If there's anything else I can do please let me know. I'm happy to do as much legwork as I can, but when I started looking into the bootstrapping code (where I suspect the problem is) I got pretty lost.
can i suggest to try the github master branch (i believe py2exe is working on that for python2)
Just tried with 0.9.10.dev0. No dice.
To be clear, the problem only happens when I have this line in my source:
import clr
and I launch the app from the bootrapping exe in the appdir. otherwise esky + py2exe is working perfectly for me.
@maxslimmer sorry this is taking a while to come through. The bootstrap is showing a few issues for py2exe, Is changing over to cxfreeze an option? We are fully tested on running with cxfreeze. I will put some effort into py2exe after my exams in march.
Hi! If I package just an import of clr and copy the Python.Runtime.dll into the folder in appdata I get the same import error. I use cxfreeze, is there a specific version that you have tested with? The exe down in the appdata folder works as expected.
I'm running: CPython 2.7.10 pythonnet 2.1.0-dev1 esky from github(29th jan) cx-Freeze 4.3.4 Windows 7
@timeyyy I looked into cxfreeze a while back and decided not to go with it for reasons I can't recall. It sounds like @jonasH might be having the same problem with cxfreeze anyway. For the time being I've found alternatives to using clr/pythonnet. The library I wanted to reference was also provided as a COM server so I'm using pywin32 to access it and was able to re-implement the network protocol of another library function using pure python. Long story short: this issue is moot for me until I need something else from .Net that I can't or won't re-implement. I'm still happy to test when and if there is something to test.
For me implementing the c# stuff is not an option, I will go with just freezing for now. If you need any help let me know.
I'm a fairly green programmer and i'm still learning the esky codebase so i cannot really delegate or tell you guys how you can help. If you want to get on board with a task take a look at the road map, some task are quite project independent such as setting up travis for osx
Anyway as a workaround until the patch is ready you can do this to get up and running with clr using cxfreeze,
data_path = os.path.join(sys.exec_prefix, 'Lib')
bscode = "_chainload = _orig_chainload\nbootstrap()"
setup(
data_files=[('', [os.path.join(data_path, 'site-packages', 'Python.Runtime.dll')]), ],
options = {"bdist_esky": {
"freezer_module":"cxfreeze",
"bootstrap_code":bscode
Thank you that worked out fine by settings the bootstrap_code option.
See my answer on stack overflow:
Getting
ImportError: No module named site
when importing clr module from pythonnet. Freezing with py2exe without esky is creating a running executable. Only get this error when building as esky and then running the executable from bootstrap exe. If I run the exe in the version directory everything works.