Skip to content
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

conda install --force implies --no-deps #2928

Closed
ilanschnell opened this issue Jun 30, 2016 · 12 comments
Closed

conda install --force implies --no-deps #2928

ilanschnell opened this issue Jun 30, 2016 · 12 comments
Labels
locked [bot] locked due to inactivity

Comments

@ilanschnell
Copy link
Contributor

ilanschnell commented Jun 30, 2016

From conda install -h (version 4.1.5):

  -f, --force           Force install (even when package already installed),
                        implies --no-deps.

I don't know when it was added that --force also implies --no-deps, but this is not how it used to be. What conda install -f used to do is simply install the package (with it's dependencies) but re-extract and possibly re-download the package.

@ilanschnell ilanschnell added the type::bug describes erroneous operation, use severity::* to classify the type label Jun 30, 2016
@mcg1969
Copy link
Contributor

mcg1969 commented Jun 30, 2016

Take it up with Aaron: 45b3cbd#diff-34bb8d01f991a5ffabae5e80b987c83fR142
It's been this way for 2.5 years.

@mcg1969 mcg1969 added 2 - Needs Discussion and removed type::bug describes erroneous operation, use severity::* to classify the type labels Jun 30, 2016
@ijstokes
Copy link

I don't have time to dig it up, but this has caught me out and I think I've reported some of the PLS-violating implications of this policy.

@ijstokes
Copy link

Found it: #1878

@mingwandroid
Copy link
Contributor

While we're talking about PLS and installation of dependencies, can anyone think up a good reason why installing from a tarball doesn't also install dependencies? I get that you may need to supply some channels, but that is better than installing things that don't work.

@mcg1969
Copy link
Contributor

mcg1969 commented Jun 30, 2016

I was wrong. It's not 2.5 years old. It's over 3 years old, and it has been there ever since --no-deps was added. Here's the commit, from @ilanschnell:
e3936b4

@mcg1969
Copy link
Contributor

mcg1969 commented Jun 30, 2016

While we're talking about PLS and installation of dependencies, can anyone think up a good reason why installing from a tarball doesn't also install dependencies?

Because we don't have information about a tarball's dependencies until after we fetch & extract. That doesn't mean we can't do it, but it requires two "plan" passes.

@mcg1969
Copy link
Contributor

mcg1969 commented Jun 30, 2016

My suggestions:

  1. create a new option, --force-extract (maybe --force-fetch as well), that implements the re-extraction functionality but otherwise behaves the same as conda without the --force option.
  2. change the behavior of tarball installation to extract the tarball metadata so its dependencies can indeed be taken into account.
  3. make extra, extra sure --no-deps is working before deploying create changelog #2.

@mcg1969
Copy link
Contributor

mcg1969 commented Jun 30, 2016

What I'd really like to do is reduce the number of reasons to use --force at all. I want --force to come with a strong implication that it may break your environment.

If we're recommending the use of --force for other reasons, such as ensuring the package is re-extracted, we're diluting the strength of that message. So that's why new options like --force-extract and --force-fetch may be warranted. In fact, maybe they should be renamed to just --extract and --fetch, or --re-extract and --re-fetch, so that the word "force" isn't in there.

On the flip-side, the fact that we can install tarballs without checking dependencies, and without using --force, also dilutes that message. Because we can break environments that way. So that's a vote for changing that behavior.

@kalefranz
Copy link
Contributor

tumblr_inline_npvaq2arbl1rujkbp_500

@mcg1969
Copy link
Contributor

mcg1969 commented Jul 1, 2016

From #1878

If I do conda install -f jupyter then I want to force-install all the dependency packages specified the jupyter meta-package.

@ilanschnell, @ijstokes: I know this has come up many times, that somehow conda install --force should pull all dependencies, too. But when I fully think through the ramifications of this I find I simply can't get to a satisfactory conclusion.

For instance, jupyter depends on python. Which Python do I choose? Do I query the environment to see what version it's using? Or what if a package is built for multiple NumPy versions; should I query the environment to figure out which version of NumPy I should prefer? Either way I'm not really ignoring the environment, which goes against the --force flag. I should be picking Python 3.5 and NumPy 1.11 every time unless an alternative is added right there on the command line.

But let's set that aside, and say the rule is: pretend the environment is empty. What if the packages I ask for are still internally inconsistent? Should conda cough up an Unsatisfiable exception? But isn't --force basically supposed to always work?

Perhaps the rule is: if it's satisfiable, make it so; but if not, just do the "best you can" in some sense. What exactly is that sense? Perhaps it should just pick the latest versions of the requested packages, and the latest versions of their dependencies, and so on. There will be a lot of tiebreaking to do, I'm guessing.

I think --force-but-with-dependencies-too simply doesn't have a well-defined specification. If someone can spec out all of these corner cases then we could put something like it on the roadmap. But since --force has behaved this way for over three years, I think we need a new name. Maybe --force --ignore-installed.

@ilanschnell
Copy link
Contributor Author

Thanks for the detailed explanations @mcg1969.
I didn't realize that the current behavior has been around for 2.5 years. I guess it is best the leave it like that. Also, this is more consistent with conda install <path to conda package>, which also ignores dependencies.

@goanpeca goanpeca added pending::discussion contains some ongoing discussion that needs to be resolved prior to proceeding and removed pending::discussion contains some ongoing discussion that needs to be resolved prior to proceeding labels Mar 23, 2017
@github-actions
Copy link

github-actions bot commented Nov 3, 2021

Hi there, thank you for your contribution to Conda!

This issue has been automatically locked since it has not had recent activity after it was closed.

Please open a new issue if needed.

@github-actions github-actions bot added the locked [bot] locked due to inactivity label Nov 3, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked [bot] locked due to inactivity
Projects
None yet
Development

No branches or pull requests

6 participants