GChristensen / enso-portable

Portable Enso Launcher community edition
Other
164 stars 46 forks source link

Upgrade enso-portable to Python 2.7 #7

Closed gilch closed 8 years ago

gilch commented 9 years ago

I'd like to use the latest available Python version for scripting commands in enso-portable, but I can't seem to figure out how you made Python 2.5 work without requiring installation, since it's in your 7z download, but not explained in the repository. I don't want to give up portability by just installing Python. I might be able to set it up in my own fork if you can tell me how you did it. It also looks like enso requires some extra Python packages. I noticed pywin32 and SendKeys. Was that all of them?

GChristensen commented 9 years ago

Hi, I fear that it's not a simple task. I think, you need to install community Enso as described in its manual, then try to make portable python 2.7 by providing Visual C++ runtime DLL's it wants and may be something additional. Then overwrite community Enso code with portable one. There was ensowiki.org with the installation guide, but it is gone now, although still available at the internet archive.

I hope this will help:

https://web.archive.org/web/20110128205130/http://www.ensowiki.com/wiki/index.php?title=Main_Page https://web.archive.org/web/20100302015633/http://www.ensowiki.com/wiki/index.php?title=Manually_Installing_Enso

thdoan commented 9 years ago

Awhile back I also tried to replace Python 2.5.4 with a newer version (also a 64-bit version), but I never succeeded. The farthest I ever got was getting this error:

  File "C:\temp\enso-portable\enso\enso\platform\win32\input\InputManager.py", line 21, in swig_import_helper
    _mod = imp.load_module('_InputManager', fp, pathname, description)
ImportError: DLL load failed: %1 is not a valid Win32 application.

I suspect enso-portable\enso\enso\platform\win32\AsyncEventProcessorRegistry.dll is the culprit. Anyway, I eventually gave up trying to update Python, since it was working just fine for me in Windows 8.1 64-bit.

robertcollier4 commented 9 years ago

The Win API layer is all 32-bit and so to use the same Input and Graphics libraries, should use Python 32-bit only. You can upgrade to a newer version of Python 32-bit and that will run fine on x64 machines.

gilch commented 9 years ago

I found Portable Python. The installer is huge, but you don't have to install all the packages. I tried dropping 32-bit Portable Python 2.7.6 in place of the Python included with enso-portable, with just the packages enso-portable appears to need.

I'm getting a similar error:

  File "C:\Users\ME\Code\repositories\enso-portable\enso\enso\platform\win32\input\InputManager.py", line 21, in swig_import_helper
    _mod = imp.load_module('_InputManager', fp, pathname, description)
ImportError: DLL load failed: The specified module could not be found.

It's failing in exactly the same line, but for a different reason it seems. This is a SWIG auto-generated file. Stepping through with the debugger, with both the old and new Python versions, I can see that it takes a different path depending on the version of Python. From the comment at the head of this file, I think editing it directly is the wrong approach. I did try taking the old branch with the new version, but that doesn't work either. I don't have much experience with SWIG, but maybe we need the SWIG interface files to fix this? I don't think they're in this repository, but maybe I don't know what I'm looking for.

I think the old community enso repository is still available at https://launchpad.net/enso , but I'm not actually sure if that's the right one. The project moved around and seems to be abandoned now.

thdoan commented 9 years ago

@gilch I think there is a missing piece of the puzzle somewhere preventing the Python upgrade. I haven't had time to look into it, but it's possible that Enso relies on something in v2.5 core (or any of its libraries) that no longer exists or has been changed in v2.7.

GChristensen commented 9 years ago

Congrats, here is Python27-based (32bit) portable Enso. Over 100Mb in weight. You want it? You get it. Basically, to port Enso to a version of python different form 2.5 you need to compile its win32 binaries from source with that version of python, SCons, right version of SWIG (3.x doesn't work and I've compiled with 1.x) and Microsoft C/C++. To not to mess with bazaar, you can get the tarball here. More info in the README there. You also may get 64-bit if you'll manage to compile the binaries for x64 platform. I'll add a new branch for 2.7 latter, if it works stable. Personally I have some troubles with the 'open' command which tells in log that it can't find some shortcuts, for example, for paint.net installed for all users as I remember (Python 2.5 version also has similar problems, so this may be my local system issue).

thdoan commented 9 years ago

@GChristensen thanks so much! I'll be testing this tonight on my Win 8.1 64-bit box.

For those thinking about upgrading to Python 2.7, here's a summary of differences between 2.5 and 2.7:

https://cloud.google.com/appengine/docs/python/python25/diff27