Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

Makes entry_points specified in load more quickly

Project Description

Using entry_points in your makes scripts that start really slowly because it imports pkg_resources, which is a horrible thing to do if you want your trivial script to execute more or less instantly. check it out:

importing fastentrypoints in your file produces scripts that look like this:

# -*- coding: utf-8 -*-
import re
import sys

from package.module import entry_function

if __name__ == '__main__':
  sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])

This is ripped directly from the way wheels do it and is faster than whatever the heck the normal console scripts do.


This bug in setuptools only affects packages built with the normal method. Building wheels avoids the problem and has many other benefits as well. fastentrypoints simply ensures that your user scripts will not automatically import pkg_resources, no matter how they are built.


To use fastentrypoints, simply copy into your project folder in the same directory as, and import fastentrypoints in your file. This monkey-patches setuptools.command.easy_install.ScriptWriter.get_args() in the background, which in turn produces simple entry scripts (like the one above) when you install the package.

If you install fastentrypoints as a module, you have the fastep executable, which will copy into the working directory (or into a list of directories you give it as arguments) and append include to the file, and add an import statement to It is available from PyPI.

You can’t really make it a proper dependency because setuptools has to import it to work, so chicken-egg. right? Luckily, the script is trivial and will not hurt you project much to copy this 60-line file into the folder. Be sure to add it to MANIFEST.ini if you want to distributie it on PyPI.

Let me know if there are places where this doesn’t work well. I’ve mostly tested it with console_scripts so far, since I don’t write the other thing.

Release History

Release History

This version
History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
fastentrypoints-0.10-py3-none-any.whl (6.3 kB) Copy SHA256 Checksum SHA256 py3 Wheel Oct 24, 2017
fastentrypoints-0.10.tar.gz (3.7 kB) Copy SHA256 Checksum SHA256 Source Oct 24, 2017

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting