Skip to content

--ignore-installed not working with pip install -e #4243

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
asmodehn opened this issue Jan 20, 2017 · 5 comments
Closed

--ignore-installed not working with pip install -e #4243

asmodehn opened this issue Jan 20, 2017 · 5 comments
Labels
auto-locked Outdated issues that have been locked by automation

Comments

@asmodehn
Copy link

  • Pip version: 9.0.1
  • Python version: 2.7
  • Operating system: Ubuntu

It seems the recent new behavior of pip install -e tries to remove existing installed packages.
Ref : https://github.com/pypa/pip/pull/3898/files

However this doesn't seems to honor the --ignore-installed flag.

I had this error when using--prefix. I was expecting the pip install to ignore whatever was installed on the system, but it tried to uninstall and didn't have permissions.

More detailed information here.

However I am doing this in a custom tool with a somehow esoteric environment.
It would be good if someone could confirm/infirm in a "usual" python environment...

@asmodehn asmodehn changed the title --ignore-installed not working with pip install -e <pkg> --prefix <path> --ignore-installed not working with pip install -e Jan 20, 2017
@pfmoore
Copy link
Member

pfmoore commented Jan 20, 2017

--ignore-installed just ignores installed packages for the purposes of deciding what to install, not for actually doing the install. When installing a new version of a package, pip will always remove existing versions (unless you are using --target) as Python won't allow multiple versions of a package to be installed at the same time.

@asmodehn
Copy link
Author

asmodehn commented Jan 21, 2017 via email

@pfmoore
Copy link
Member

pfmoore commented Jan 21, 2017

--prefix is for when you want to install in a non-standard site-packages location, so your "prefix" directory contains the standard structure underneath, and is expected to be part of your sys.path. So clashes with what is currently on sys.path are a problem, and hence if you're installing a newer copy of something already present, that older copy should be uninstalled first.

--target is for just placing a package somewhere in the filesystem. It may or may not end up on your sys.path (it's often used for vendoring or for bundling dependencies in a zipapp) and what's on your sys.path is expected to be irrelevant (because you won't be using the installed package in the runtime environment you currently have).

There's also --root which is somehow similar to but different from prefix. I freely admit I don't understand the distinction (I don't personally use --prefix or --root).

Hopefully this helps you - from what I can see the "catkin pip" environment you hit this in may be doing nonstandard things with sys.path and so you may have to work to get the behaviour you want from standard pip.

@asmodehn
Copy link
Author

asmodehn commented Jan 21, 2017 via email

@pfmoore
Copy link
Member

pfmoore commented Jan 21, 2017

The problematic expectation here is that catkin allows multiple versions of
the same package to be installed on the system, one eventually overriding
another one, depending on the order of the paths in PYTHONPATH.

Yes, I thought that was what you were doing. This is not really how PYTHONPATH is meant to be used, so you will hit issues - it's not specifically a pip problem, it's how core Python handles sys.path. For example, if version 1 of package foo exists on sys.path before version 2, but version 2 introduced a subpackage foo.bar, you could end up importing version 1 of foo but version 2 of foo.bar (as there's no version 1 foo.bar to shadow it). That's very rare in practice, and so isn't likely to be a practical issue for you, but for general tools like pip we need to consider the rare corner cases.

Setuptools used to have a system for supporting multi-versioned packages via eggs. AFAIK, it's rarely if ever used today, and is viewed as an experiment that didn't work out. You may find some information by digging into the history of that approach (your specific needs may well mean that you can overcome the difficulties they had, so don't assume that the fact that their approach didn't take off means you're doomed!)

As per your request, I'll close this issue, but feel free to open new ones (or even reopen this one) if you have other questions or think you've found problems. I'm sure there are places where pip does the wrong thing, as this isn't a frequently used are of the code. And if nothing else, the discussion could suggest ways we could improve the docs!

@pfmoore pfmoore closed this as completed Jan 21, 2017
@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Jun 3, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jun 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation
Projects
None yet
Development

No branches or pull requests

2 participants