Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I installed a little python software (pycarddav) before to notice there is a packaged version for Debian sid...

Now, I would like to uninstall properly this software and then, install the packaged version with apt.

Here is what I did to install pycarddav (following its doc):

  1. Download pycarddav and extract it
  2. Go to the folder and launch python setup.py install which contain:
#!/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='pycarddav@lostpackets.de',
    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"
    ],
)

How can I remove it properly?

Can I use pip uninstall pycarddav even if I didn't use pip for the installation?

share|improve this question
    
As suggested on chat, run setup.py install again. This time, save the output. My experience has been that setup.py is quite chatty, and will tell you where it is writing things to. Then you can go in there and manually remove it. –  Faheem Mitha May 27 at 0:14

1 Answer 1

According to the documentation pip cannot uninstall these types of installs.

excerpt - http://pip.readthedocs.org/en/latest/reference/pip_uninstall.html

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.
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.