EzDevInfo.com

esky

an auto-update framework for frozen python apps

Esky, no frozen versions found

Just following an online tutorial to get a grasp of Esky.
tutorial here - at correct timestamp

I can get the "factorial.py" file to run, without Esky - that's basic. Building the exe, in both py2exe and esky form, easy enough.

However, when running the factorial.py (or .exe) with the new Esky lines included, fails, code below

Traceback (most recent call last):
  File "factorial.py", line 4, in <module>
    app = esky.Esky(sys.executable, "http://localhost:8000")
  File "C:\Python27\lib\site-packages\esky\__init__.py", line 249, in __init__
    self.reinitialize()
  File "C:\Python27\lib\site-packages\esky\__init__.py", line 317, in reinitialize
    raise EskyBrokenError("no frozen versions found")
esky.errors.EskyBrokenError: no frozen versions found

I've got the Esky .zip file on a localhost HTTP server, as the demo does, and I can navigate to it through a browser.

Note:
I'm on Python2.7
I've written the code, letter for letter, as the lecturer does

All help appreciated


Source: (StackOverflow)

Why does esky create 2 executables?

esky 0.9.8 creates 2 executables of my application.
There is an inner executable that weights less then the outer executable.
I would like to know if esky is supposed to create 2 executables and if there are any drawbacks or advantages in creating 2 executables.
I would also like to know which executable should I be calling when I want to run my application.


Source: (StackOverflow)

Advertisements

package a software for Windows with wine

I use Esky/cx_freeze to package a python program for different OS. When I have to do it for windows, I use Windows 7 on VirtualBox.

However, I find this method pretty unpleasant and heavy. So I wonder, is there a way to package programs for Windows through Wine ?

I would basically need to install all the libraries I need, then run some commands like "python setup.py bdist_esky".

I know the cx_freeze doc doesn't advice this, but I'm trying to find a better way to package my software. I wonder if someone has a better option.


Source: (StackOverflow)

Python script into a standalone single file executable that can auto-update?

I wrote a program in Python 2.7 for my office. Using PyInstaller with the --onefile flag, I've compiled it into a single EXE file to distribute to my co-workers. What I'm trying to figure out now is how to supply updates automatically but still keep the program as a single file.

My current method is to have the program alert the user of a new version and give instructions where to obtain the updated file. This works, but I want to find some method of updating without the user's involvement.

I am aware of Esky, which can create auto-updating Python programs, but as far as I can tell, it requires the program to exist as multiple files.

Any suggestions on how I make a standalone, single file EXE python program that can auto-update?


Source: (StackOverflow)

Using esky with GUI program?

I have a GUI program written in python and packaged with py2exe. I now want to use Esky to allow automatic updating.

However when I'm runningpython setup.py bdist_esky, I get the following error:

RuntimeError: don't call setup(windows=[...]) with esky; use setup(scripts=[...]) instead

When changing to scripts, I get the following error:

TypeError: Must specify name if script is not a file

I cant manage to get rid of it. Any help?

(setup.py: http://pastebin.com/B3yGJERq)


Source: (StackOverflow)

How can I move config file between esky updates?

I have an ini file that contains the configuration of my app.

Esky creates new folders for the updated versions. How can I make sure that configuration file gets copied?


Source: (StackOverflow)

How to hide console window using python esky 0.9.8?

I currently have an exe that I created using python bundled up with the esky package(https://pypi.python.org/pypi/esky).
My setup file looks like this

setup(name='pythonApp',
  version = "0.1",
  scripts=[pythonAppEXE],
  options = {'bdist_esky':{
      'freezer_module': 'py2exe',
      },},

)
Now i know that in py2exe you can use windows=[pythonAppEXE] instead of scripts=[pythonAppEXE], but unfortunately I cannot replace scripts=[pythonAppEXE] when using esky.
So how can I create an exe that doesn't have a console?


Source: (StackOverflow)

Auto updating a python executable generated with pyinstaller

I have a desktop app that I'm working on and I am using PyInstaller to generate de distribution files.

I have chosen PyInstaller over py2exe because it is very easy to use and I don't need to care about windows dlls, but when I use py2exe I can simply use Esky to autoupdate, but I can't use it with PyInstaller.

So I don't know how to start a auto-updating application. Someone have some thoughts or just know how can I use PyInstaller and esky?


Source: (StackOverflow)

Python Project Structure for Esky

My question is essentially, "How should I structure the files and folders of my frozen, deployed Python-based Windows application." To understand my situation, here's some background:

I'm building a desktop application with Python 2.7 for my workplace. It is a GUI-based application built on PyQt. I am building the application with Esky which is a cross-platform freezing and updating framework. Esky basically wraps/calls py2exe, py2app, bb_freeze, or whatever tool you have installed that is appropriate for the current platform. Esky creates a zipped package that looks like this:

prog.exe                     - esky bootstrapping executable
appdata/                     - container for all the esky magic
  appname-X.Y.platform/      - specific version of the application
    prog.exe                 - executable(s) as produced by freezer module
    library.zip              - pure-python frozen modules
    pythonXY.dll             - python DLL
    esky-files/              - esky control files
      bootstrap/             - files not yet moved into bootstrapping env
      bootstrap-manifest.txt - list of files expected in bootstrap env
      lockfile.txt           - lockfile to block removal of in-use versions
      ...other deps...
  updates/                   - work area for fetching/unpacking updates

These zipped packages can then be placed on a file server which Esky looks to for updates. A number of methods are provided for managing updates including a very simple auto_update(). When an update occurs, the appname-X.Y.platform folder is essentially replaced with the next version folder... so the myApp.0.1.win32 folder is replaced by a myApp.0.2.win32 folder.

The other aspect of background you should know is that I am distributing the application to my coworkers, who do not have Python installed. I'm not distributing a Python package or library, I'm deploying a desktop application (my coworkers don't particularly care what it's written in, just that it works). I've built an Inno installer which installs the application, provides an uninstaller, and various shortcuts. Because everyone on the team has essentially the same Windows 7 64-bit environment, I'm pretty safe building for just that platform.

So, back to the issue of structure. I've read guides that recommend a certain format for a project skeleton, such as Learn Python the Hard Way, Exercise 46 or the Hitchhiker's Guide to Packaging. However these guides are oriented toward Python package developers, not compiled application developers.

I've also run into problems with Esky's appname-X.Y.platform folder, since it changes names every time the program is updated (to reflect the version number). Because I want some shortcuts in the Start Menu to always refer to documentation, changelog, etc, I have the installer place some of those files under the appdata folder. When the program updates, I have some code to check for newer versions of those files I want to be externally "visible" and copy the newer versions out of the appname-X.Y.platform folder and overwrite the copies in the appdata folder. I then also needed a means of storing persistent user settings, so the program generates and uses an appdata\settings folder (otherwise the settings would be wiped with each update).

Should I continue the process of having the application push new files out to the appdata folder post-update? Should I build my own structure of Docs, Examples, Settings, etc. and let the program populate those folders with newer files whenever necessary? Should I attempt to alter or take better advantage of Esky's behavior to better fit my usage? Perhaps I should rework my application to be destributable as both a Python package and an end-user application?

This question relates to this one about static files with Esky, this one about Python deployed application structure, and numerous generic questions about Python project structure which don't specifically address using Esky. Some videos discussing Esky are also available here and here.

I'm seeking recommendations for "best practice" methods to handle these challenges. If this doesn't fit the StackOverflow Question format, I'll gladly attempt to reword or narrow the focus of my question.


Source: (StackOverflow)

Get progress by Esky tasks

I'm using Esky with my frozen app. It has the following properties and methods are available on the Esky class:

app.version:                the current best available version.

app.active_version:         the currently-executing version, or None
                            if the esky isn't for the current app.

app.find_update():          find the best available update, or None
                            if no updates are available.

app.fetch_version(v):       fetch the specified version into local storage.

app.install_version(v):     install and activate the specified version.

Now, that's nice and all, but I want to show the progress of the download task in my Gui.

How can I achieve that?


Source: (StackOverflow)

How do I freeze Celery using py2exe and esky?

I'm trying to freeze a Python application and Celery, packaged up with esky for update capabilities. I need Celery to be frozen so that it has visibility into the modules from the first executable that will also be present in the library.zip file that py2exe creates.

The problem is that I cannot get Celery to freeze with esky. Here's a bare minimum, stripped down setup.py file that I'm using to try and find a solution around the problem:

from esky import bdist_esky
from distutils.core import setup

setup(name='ColdCelery',
      scripts=['C:\\Python27\\Lib\\site-packages\\celery\\bin\\celery.py'],
      options = {
          'bdist_esky':{
              'freezer_module': 'py2exe',
          }
      }
)

When I run the following command:

python setup.py bdist_esky

I get the following error:

running bdist_esky
running build_scripts
*** searching for required modules *** 
error: c:\temp\tmpz5146o\scripts\celery.py: The process cannot access the file
because it is being used by another process

There is no running Python process on the machine that could be using Celery. I assume this is a conflict between py2exe and esky, but don't know how to overcome it.

I can freeze Celery using py2exe without referencing esky without a problem, but I will require being able to update this project in the future, so esky support is a must.


Source: (StackOverflow)

Using Esky to Freeze/Package a Cocoa PyObjC Python Application

So I'm trying to put together an auto-update functionality for my standalone OSX Python application, that's built on PyObjC. It works great simply packaging it via py2app, but I'm attemping to freeze it with Esky as part of an effort to implement the update feature.

As far as I can tell it's my setup.py formatting for Esky. I'm not sure exactly how to tell Esky to pass on the name of my .Xib file to py2app. Here's what my direct py2app setup.py looks like, successfully including the required .Xib file for the GUI:

setup.py for Py2app

from setuptools import setup

APP = ['MyApp.py']
DATA_FILES = ['MyApp.xib']
OPTIONS = {'argv_emulation': False, 'packages' : ['PIL']}

setup(
    app=APP,
    data_files=DATA_FILES,
    options={'py2app': OPTIONS},
    setup_requires=['py2app'],
    iconfile="MyApp.icns"
)

Looking around at other people's posts, it looks like you can pass settings to py2app via the slightly differently structured Esky setup.py, but I can't for the life of me figure out the exact structure of the arguments to pass the .Xib file to py2app, from Esky.

setup.py for Esky

from esky import bdist_esky
from distutils.core import setup

setup(name="MyApp",
      version="1.3.3",
      iconfile="MyApp.icns",
      data_files=['MyApp.xib'],
      scripts=["MyApp.py","midheaven.py"],
      options={"bdist_esky":{
      "includes":["PIL"],
      "excludes":['pydoc'],
      "freezer_module": "py2app",
      "freezer_options": {
                "plist": {
                    'argv_emulation': False,
                    'packages': ['PIL'],
                },
                "data_files": ['MyApp.xib'],
            },
      },
      },

     )

Everything packages without an error, but of course if I try to run the Esky freeze of the app it crashes right away. I'm positive it's because it's not attaching the .Xib GUI properly. Anyone have experience with this, or ideas on how this should actually be formatted? Would absolutely love to figure this out and have it up on here for posterity.


Source: (StackOverflow)

importerror no module named pysnmp.entity.rfc3413.oneliner(when using esky)

I have python 2.7 installed on my computer.
It has the following packages:
py2exe
esky 0.9.8
pysnmp
when i run the python code that uses pysnmp it works fine:

python snmp.py #this code works

then executable out of the code using esky

python snmp.py bdist_esky 

and then i run the extracted exe and get the following error:

importerror no module named pysnmp.entity.rfc3413.oneliner 

Source: (StackOverflow)

can't uninstall latest version in Esky

I am trying to uninstall a version in esky using "app.uninstall_version(v)", but when I do so I get this error:

[Error 5] Access is denied.
Traceback (most recent call last):
  File "Example.py", line 35, in EskyUpdate
  File "esky\__init__.pyc", line 951, in uninstall_version
  File "esky\__init__.pyc", line 1008, in _cleanup_bootstrap_env
  File "esky\fstransact\win32txf.pyc", line 200, in remove
  File "esky\fstransact\win32txf.pyc", line 214, in _remove
  File "esky\fstransact\win32txf.pyc", line 24, in wrapper
WindowsError: [Error 5] Access is denied.  

My program installs a new version of the program once available and opens the new version in a different process and then waits for its exit code. If the exit code equals 0 then it restarts itself to get the new version running, but if the exit code does not equal 0(meaning there is an error in the new version) then the program will delete the new version and continue running normally.
here's the code:

def EskyUpdate():
if getattr(sys,"frozen",False):
    app = esky.Esky(sys.executable,"http://example.com/downloads/")
    updateVersion = app.find_update()
    if(updateVersion != None):
        app.fetch_version(updateVersion)
        app.install_version(updateVersion)
        appexe = esky.util.appexe_from_executable(sys.executable)
        exitCode = subprocess.call(appexe)#calls the new version in a different process
        if exitCode == 0:
            os.execl(appexe, *([appexe]+sys.argv))
        else:
            app.uninstall_version(updateVersion)#this is where the error occurs

Why am I getting the "Access is denied" error when i try to uninstall the new version, and how can I uninstall the new version?


Source: (StackOverflow)

Can't delete old versions in esky 0.9.8 : Python

I use esky 0.9.8 : Python.
I update my executable frequently to a new version using esky.
This works all and well besides the fact that esky doesn't erase the old version of the executable.
This is the code I use:

if getattr(sys,"frozen",False):
app = esky.Esky(sys.executable,"https://example-app.com/downloads/")
print "You are running: %s" % app.active_version
try:
    if(app.find_update() != None):
        app.auto_update()
        appexe = esky.util.appexe_from_executable(sys.executable)
        os.execv(appexe,[appexe] + sys.argv[1:])
except Exception, e:
    print "ERROR UPDATING APP:", e
app.cleanup()

Everything here works well besides the last line "app cleanup()", because it doesn't delete the old versions.
In my executables folder I have the following:

App.exe App.old.exe App.old.old.exe

and so on.

Why doesn't esky delete the old version of my Executable?


Source: (StackOverflow)