编写一个python模块,以便可以卸载它

时间:2014-12-19 17:41:44

标签: python pip setuptools pypi

我正在为PyPi创建一个Python包:

# setup.py
from setuptools import setup

setup(
    name='ubuntudesign-asset-mapper',
    version='0.2',
    author='Robin',
    author_email='robin.winslow@canonical.com',
    url='https://github.com/ubuntudesign/asset-mapper',
    packages=[
        'ubuntudesign'
    ],
    description=(
        'A mapping class for using the Ubuntu asset server.'
    ),
    long_description=open('README.rst').read(),
    install_requires=[
        "requests >= 2.0"
    ]
)

我已成功设置on PyPi,我可以安装它:

$ pip install ubuntudesign-asset-mapper
Downloading/unpacking ubuntudesign-asset-mapper
  Downloading ubuntudesign-asset-mapper-0.2.tar.gz
  Running setup.py (path:/home/robin/.virtualenvs/assets-server/build/ubuntudesign-asset-mapper/setup.py) egg_info for package ubuntudesign-asset-mapper

Requirement already satisfied (use --upgrade to upgrade): requests>=2.0 in /home/robin/.virtualenvs/assets-server/lib/python2.7/site-packages (from ubuntudesign-asset-mapper)
Installing collected packages: ubuntudesign-asset-mapper
  Running setup.py install for ubuntudesign-asset-mapper

Successfully installed ubuntudesign-asset-mapper
Cleaning up...
$ pip freeze | grep ubuntud
ubuntudesign-asset-mapper==0.2

但现在它不会让我卸载它:

$ pip uninstall ubuntudesign-asset-mapper
Can't uninstall 'ubuntudesign-asset-mapper'. No files were found to uninstall.

我确定这是因为我没有正确地写出setup.py,但我在网上找不到任何关于这个问题的提法,所以我不知道我做错了什么。

0 个答案:

没有答案