Pip removes work but gives error

I downloaded, built and installed a sample pypi project. It is assumed that the project is used to give an idea of ​​python packaging and is referenced in the Python Packaging User Guide and Packaging and Distributing Projects . Therefore, I am confused by why on earth, following their instructions for creating a package, I have an error when deleting it.

As mentioned above, I used my sample project. If someone can shed light, it will be appreciated.

Key notes: I am running Mac OSX, my installed python version is 3.5.1 The following are the steps to reproduce the problem:

mkdir testdirectory 
cd testdirectory/
pyvenv venv    # Creating a virtual environment
source venv/bin/activate
git clone https://github.com/pypa/sampleproject.git    # Getting sample project
cd sampleproject/
python setup.py build
python setup.py install    # Installing on the virtual environment

pip list
peppercorn (0.5)
pip (7.1.2)
sample (1.2.0)
setuptools (18.2)

pip uninstall sample

The result of the following output:

Uninstalling sample-1.2.0:
  /Users/steve/testdirectory/venv/bin/sample
  /Users/steve/testdirectory/venv/lib/python3.5/site-packages/sample-1.2.0-py3.5.egg
Proceed (y/n)? y
  Successfully uninstalled sample-1.2.0
Traceback (most recent call last):
  File "/Users/steve/testdirectory/venv/bin/pip3", line 11, in <module>
    sys.exit(main())
  File "/Users/steve/testdirectory/venv/lib/python3.5/site-packages/pip/__init__.py", line 217, in main
    return command.main(cmd_args)
  File "/Users/steve/testdirectory/venv/lib/python3.5/site-packages/pip/basecommand.py", line 248, in main
    pip_version_check(session)
  File "/Users/steve/testdirectory/venv/lib/python3.5/site-packages/pip/utils/outdated.py", line 102, in pip_version_check
    installed_version = get_installed_version("pip")
  File "/Users/steve/testdirectory/venv/lib/python3.5/site-packages/pip/utils/__init__.py", line 858, in get_installed_version
    working_set = pkg_resources.WorkingSet()
  File "/Users/steve/testdirectory/venv/lib/python3.5/site-packages/pip/_vendor/pkg_resources/__init__.py", line 629, in __init__
    self.add_entry(entry)
  File "/Users/steve/testdirectory/venv/lib/python3.5/site-packages/pip/_vendor/pkg_resources/__init__.py", line 685, in add_entry
    for dist in find_distributions(entry, True):
  File "/Users/steve/testdirectory/venv/lib/python3.5/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2075, in find_eggs_in_zip
    if metadata.has_metadata('PKG-INFO'):
  File "/Users/steve/testdirectory/venv/lib/python3.5/site-packages/pip/_vendor/pkg_resources/__init__.py", line 1605, in has_metadata
    return self.egg_info and self._has(self._fn(self.egg_info, name))
  File "/Users/steve/testdirectory/venv/lib/python3.5/site-packages/pip/_vendor/pkg_resources/__init__.py", line 1963, in _has
    return zip_path in self.zipinfo or zip_path in self._index()
  File "/Users/steve/testdirectory/venv/lib/python3.5/site-packages/pip/_vendor/pkg_resources/__init__.py", line 1843, in zipinfo
    return self._zip_manifests.load(self.loader.archive)
  File "/Users/steve/testdirectory/venv/lib/python3.5/site-packages/pip/_vendor/pkg_resources/__init__.py", line 1783, in load
    mtime = os.stat(path).st_mtime
FileNotFoundError: [Errno 2] No such file or directory: '/Users/steve/testdirectory/venv/lib/python3.5/site-packages/sample-1.2.0-py3.5.egg'

, , .

+4
2

:

$ pip help uninstall

Usage:
  pip uninstall [options] <package> ...
  pip uninstall [options] -r <requirements file> ...

Description:
  Uninstall packages.

  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``.

. , pip - setup.py, pip , .

+6

python setup.py install, pip install .

0

All Articles