[Distutils] Installing from a wheel

Paul Moore p.f.moore at gmail.com
Wed Aug 21 15:08:18 CEST 2013


On 21 August 2013 13:59, Oscar Benjamin <oscar.j.benjamin at gmail.com> wrote:

> This is the first time that I've tested using wheels and I have a
> couple of questions.
>
> Here's what I did (is this right?):
>
> $ cat spam.py
> # spam.py
> print('running spam from:', __file__)
> $ cat setup.py
> from setuptools import setup
>
> setup(name='spam',
>       version='1.0',
>       py_modules=['spam'])
>
> $ python setup.py bdist_wheel
> running bdist_wheel
>     ...
> creating build\bdist.win32\wheel\spam-1.0.dist-info\WHEEL
> $ ls
> build  dist  setup.py  spam.egg-info  spam.py
> $ ls dist/
> spam-1.0-py27-none-any.whl
>
> Okay, so far so good. I have the wheel and everything makes sense.


Looks good. You might want to add the (undocumented) universal flag to
setup.cfg, as your wheel is Python only and works for Python 2 and 3, and
so not version-specific.

setup.cfg:

[wheel]
universal=1


> Now
> I want to test installing it:
>
> $ wheel install --wheel-dir=./dist/ spam
>
> The line above gives no output. I expect something like 'installing
> spam... installed.'. It also ran so quickly that I thought that
> nothing had happened.
>
> A quick check reveals that the module was installed:
>
> $ cd ~
> $ python -m spam
> ('running spam from:', 'q:\\tools\\Python27\\lib\\site-packages\\spam.py')
> $ pip list | grep spam
> spam (1.0)
>

Looks good. I thought wheel install gave some progress output, but it's a
long time since I used it and I may be misremembering. You can also use pip
install --use-wheel if you prefer (assuming you have pip 1.4+)

So now how do I uninstall it?
>
> $ pip uninstall spam
> Can't uninstall 'spam'. No files were found to uninstall.
>
> The wheel command doesn't seem to have an uninstall option either
>

Odd. pip uninstall should work. Can you confirm your version of pip and
wheel? And can you list the contents of the spam-1.0.dist-info directory in
your site-packages?

Paul
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/distutils-sig/attachments/20130821/a1c7288e/attachment.html>


More information about the Distutils-SIG mailing list