Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to easy_install egg plugin and load it without restarting application?
    primarykey
    data
    text
    <p>I'm creating an app that downloads and installs its own egg plugins, but I have a problem loading the egg after easy_install extracts it into place. This is how it works now:</p> <ul> <li>App downloads egg into temp folder</li> <li>Installs egg with setuptools.command.easy_install.main() into ~/.app/plugins folder (which is pointed by a pth on dist-packages)</li> <li>At this point, the ~/.apps/plugins/easy-install.pth is updated with the new egg path</li> </ul> <p>The problem is that the pth is not reloaded until the python process is relaunched, which means the app has to be stopped and restarted (app is a long-running process, and plugin installation must not require a restart).</p> <p>So the question is how to, either reload the pth programatically so that plugin entry-point discovery works for the new egg, or somehow have easy_install return the path it installed the egg into, so I can manually (with pkg_resources) load the new plugin?</p> <p>I could create a function that tries to guess the easy_install'ed path or parse the pth on my own, but I prefer not to, if at all possible.</p> <p>Python 2.6, setuptools 0.6c9</p> <hr> <p>Thanks to <a href="https://stackoverflow.com/questions/3231011/how-to-easy-install-egg-plugin-and-load-it-without-restarting-application/3249176#3249176">Marius Gedminas</a>, what I'm doing now basically is:</p> <pre><code>dist = pkg_resources.get_distribution(plugin_name) entry = dist.get_entry_info(entry_point_name, plugin_name) plugin = entry.load() </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload