10

I'm running into the following problem with python whl packages:

I have a package with a single entrypoint defined in my setup.py. When I run pip install ., it installs the package AND the entry point wrapper properly. When I run python setup.py bdist_wheel followed by pip install thing.whl, it only install the package, but not the entrypoint.

How do I install the entrypoint properly from the created wheel package?

PS: When I unzip the wheel package, I do find "entrypoints.txt" with the expected entry. It just doesn't get installed in the environment bin.

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
A.J.Rouvoet
  • 1,203
  • 1
  • 14
  • 29
  • I'm not sure I get the problem. The pip install method doesn't work? – Eric Nov 08 '14 at 06:13
  • I tried to improve the wording a bit. The `pip install .` works, but this requires a source distribution. Packaging it using wheel and installing the package doesn't work, because the entrypoint is not installed in the bin. – A.J.Rouvoet Nov 08 '14 at 06:23

1 Answers1

8

Wheels used to include pre-generated console script wrappers in the package, but this was sub-optimal and the files were removed. The installer is supposed to generate these wrapper scripts instead, but pip has not yet been updated to follow suit, see issue 1067.

Until pull request 1251 is part of a release, you'll have to use a separate command to install console scripts:

python -m wheel install-scripts thing.whl

See Setuptools scripts handling in the Wheel documentation.

The pull request was merged earlier this month (November 2014), and will be part of the upcoming 6.0 release. You could also use pip to upgrade itself to the development version from GitHub with:

pip install git+https://github.com/pypa/pip.git
Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
  • If `pkg_resources.DistributionNotFound` was raised instead, you may have to just run `python -m wheel install ` and then `python -m wheel install-scripts pkg` afterwards, as the package may require something in itself for that script to work. – metatoaster Oct 08 '16 at 04:10