Skip to content

Pip uninstall a old version failed when we specify a newer version to install #4331

Description

@MrKiven
  • Pip version: 9.0.1
  • Python version: 2.7.5
  • Operating system: centos 7.1.1503

Description:

we try to install a newer version of a package , pip will uninstall old version first, but uninstall failed sometimes when try to remove a console-scripts.

In setup.py:

entry_points = {
    'console_scripts': [
        'ves = some_path',
    ],

Then the exception is:

Found existing installation: mypackage-x.y.z
Uninstalling mypackage-x.y.z:
Exception:
Traceback (most recent call last):
File "/srv/ves/.vespenenv/lib/python2.7/site-packages/pip/basecommand.py", line 211, in main
status = self.run(options, args)
File "/srv/ves/.vespenenv/lib/python2.7/site-packages/pip/commands/install.py", line 311, in run
root=options.root_path,
File "/srv/ves/.vespenenv/lib/python2.7/site-packages/pip/req/req_set.py", line 640, in install
requirement.uninstall(auto_confirm=True)
File "/srv/ves/.vespenenv/lib/python2.7/site-packages/pip/req/req_install.py", line 716, in uninstall
paths_to_remove.remove(auto_confirm)
File "/srv/ves/.vespenenv/lib/python2.7/site-packages/pip/req/req_uninstall.py", line 125, in remove
renames(path, new_path)
File "/srv/ves/.vespenenv/lib/python2.7/site-packages/pip/utils/__init__.py", line 315, in renames
shutil.move(old, new)
File "/usr/lib64/python2.7/shutil.py", line 301, in move
copy2(src, real_dst)
File "/usr/lib64/python2.7/shutil.py", line 130, in copy2
copyfile(src, dst)
File "/usr/lib64/python2.7/shutil.py", line 82, in copyfile
with open(src, 'rb') as fsrc:
IOError: [Errno 2] No such file or directory: '/srv/ves/.vespenenv/bin/ves'

What I've run:

we just run this in start.sh

/srv/ves/.vespenenv/bin/pip install mypackage==x.y.z+1 -f .wheelhouse --no-index

This has already perplexed me for a long time, it does not always reproduce...

Metadata

Metadata

Assignees

No one assigned

    Labels

    auto-lockedOutdated issues that have been locked by automationstate: needs reproducerNeed to reproduce issue

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions