Desinstalar um software python corretamente

1

Eu instalei um pequeno software python ( pycarddav ) antes de notar que há uma versão empacotada para o Debian sid ...

Agora, eu gostaria de desinstalar este software corretamente e, em seguida, instalar a versão empacotada com o apt.

Aqui está o que eu fiz para instalar o pycarddav (seguindo seu documento):

  1. Faça o download do pycarddav e extraia-o
  2. Vá até a pasta e inicie python setup.py install , que contêm:
#!/usr/bin/env python2

import os
import string
import subprocess
import sys
import warnings

#from distutils.core import setup
from setuptools import setup

MAJOR = 0
MINOR = 7
PATCH = 0

RELEASE = True

VERSION = "{0}.{1}.{2}".format(MAJOR, MINOR, PATCH)

if not RELEASE:
    try:
        try:
            pipe = subprocess.Popen(["git", "describe", "--dirty", "--tags"],
                                    stdout=subprocess.PIPE)
        except EnvironmentError:
            warnings.warn("WARNING: git not installed or failed to run")

        revision = pipe.communicate()[0].strip().lstrip('v')
        if pipe.returncode != 0:
            warnings.warn("WARNING: couldn't get git revision")

        if revision != VERSION:
            revision = revision.lstrip(string.digits + '.')
            VERSION += '.dev' + revision
    except:
        VERSION += '.dev'
        warnings.warn("WARNING: git not installed or failed to run")


def write_version():
    """writes the pycarddav/version.py file"""
    template = """\
__version__ = '{0}'
"""
    filename = os.path.join(
        os.path.dirname(__file__), 'pycarddav', 'version.py')
    with open(filename, 'w') as versionfile:
        versionfile.write(template.format(VERSION))
        print("wrote pycarddav/version.py with version={0}".format(VERSION))

write_version()


requirements = [
    'lxml',
    'vobject',
    'requests',
    'urwid',
    'pyxdg'
]
if sys.version_info[:2] in ((2, 6),):
    # there is no argparse in python2.6
    requirements.append('argparse')

setup(
    name='pyCardDAV',
    version=VERSION,
    description='A CardDAV based address book tool',
    long_description=open('README.rst').read(),
    author='Christian Geier',
    author_email='[email protected]',
    url='http://lostpackets.de/pycarddav/',
    license='Expat/MIT',
    packages=['pycarddav', 'pycarddav.controllers'],
    scripts=['bin/pycardsyncer', 'bin/pc_query', 'bin/pycard-import'],
    requires=requirements,
    install_requires=requirements,
    classifiers=[
        "Development Status :: 4 - Beta",
        "License :: OSI Approved :: MIT License",
        "Environment :: Console :: Curses",
        "Intended Audience :: End Users/Desktop",
        "Operating System :: POSIX",
        "Programming Language :: Python :: 2 :: Only",
        "Topic :: Utilities",
        "Topic :: Communications :: Email :: Address Book"
    ],
)

Como posso removê-lo corretamente?

Posso usar pip uninstall pycarddav mesmo se eu não use pip para a instalação?

    
por ppr 26.05.2014 / 23:17

1 resposta

2

De acordo com a documentação pip não pode desinstalar esses tipos de instalação.

excerto - link

pip is able to uninstall most installed packages. Known exceptions are:

  • Pure distutils packages installed with python setup.py install, which leave behind no metadata to determine what files were installed.
  • Script wrappers installed by python setup.py develop.
    
por 27.05.2014 / 01:58

Tags