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

How to avoid superceding? #2898

Closed
ijstokes opened this issue Jun 28, 2016 · 10 comments
Closed

How to avoid superceding? #2898

ijstokes opened this issue Jun 28, 2016 · 10 comments
Labels
locked [bot] locked due to inactivity

Comments

@ijstokes
Copy link

I was trying to install a Conda package during a demo. I was surprised to see that the Conda package plan decided to use a Conda package I created end of 2015 and that is available in my channel. I understand why matching packages from explicitly listed channels might have preference, even if it results in a downgrade. But is there a way to say "don't do that?" I imagine if I had a "newer" version in an explicitly listed channel then I might expect different behavior than an older version, but maybe not.

And in the case of Conda (unsurprisingly) there are clearly dangers to having your own conda package in a channel. It isn't a dependency of the listed genepattern package, so this is just the "automatically update conda and conda-env" behavior that is then pulling in my custom Conda build. Which then totally breaks my Anaconda distribution (conda is now gone from my installation -- I will have to hand-patch it back in, I think)

$ conda install -c ijstokes -c conda-forge genepattern
Using Anaconda Cloud api site https://api.anaconda.org
Fetching package metadata .............
Solving package specifications: ..........

Package plan for installation in environment /Users/ijstokes/anaconda:

The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    conda-env-2.5.1            |           py27_0          26 KB
    conda-3.18.4               |           py27_0         176 KB  ijstokes
    widgetsnbextension-1.2.3   |           py27_1         1.1 MB  conda-forge
    ------------------------------------------------------------
                                           Total:         1.3 MB

The following NEW packages will be INSTALLED:

    genepattern:        0.5.0-py27_0 ijstokes   
    widgetsnbextension: 1.2.3-py27_1 conda-forge

The following packages will be UPDATED:

    conda-env:          2.5.0-py27_0             --> 2.5.1-py27_0          

The following packages will be SUPERCEDED by a higher-priority channel:

    conda:              4.1.3-py27_0             --> 3.18.4-py27_0 ijstokes

Proceed ([y]/n)? y

Pruning fetched packages from the cache ...
Fetching packages ...
conda-env-2.5. 100% |##############################| Time: 0:00:00 804.36 kB/s
conda-3.18.4-p 100% |##############################| Time: 0:00:00 863.08 kB/s
widgetsnbexten 100% |##############################| Time: 0:00:00   2.02 MB/s
Extracting packages ...
[      COMPLETE      ]|#################################################| 100%
Unlinking packages ...
[      COMPLETE      ]|#################################################| 100%
Linking packages ...
An unexpected error has occurred, please consider sending the           |  25%
following traceback to the conda GitHub issue tracker at:

    https://github.com/conda/conda/issues

Include the output of the command 'conda info' in your report.


Traceback (most recent call last):
  File "/Users/ijstokes/anaconda/bin/conda", line 6, in <module>
  File "/Users/ijstokes/anaconda/lib/python2.7/site-packages/conda/cli/main.py", line 120, in main
  File "/Users/ijstokes/anaconda/lib/python2.7/site-packages/conda/cli/main.py", line 130, in args_func
  File "/Users/ijstokes/anaconda/lib/python2.7/site-packages/conda/cli/main_install.py", line 69, in execute
  File "/Users/ijstokes/anaconda/lib/python2.7/site-packages/conda/cli/install.py", line 407, in install
  File "/Users/ijstokes/anaconda/lib/python2.7/site-packages/conda/plan.py", line 591, in execute_actions
  File "/Users/ijstokes/anaconda/lib/python2.7/site-packages/conda/instructions.py", line 136, in execute_instructions
  File "/Users/ijstokes/anaconda/lib/python2.7/site-packages/conda/instructions.py", line 79, in LINK_CMD
  File "/Users/ijstokes/anaconda/lib/python2.7/site-packages/conda/install.py", line 1089, in link
  File "/Users/ijstokes/anaconda/lib/python2.7/site-packages/conda/install.py", line 208, in _link
  File "/Users/ijstokes/anaconda/lib/python2.7/shutil.py", line 130, in copy2
    copyfile(src, dst)
  File "/Users/ijstokes/anaconda/lib/python2.7/shutil.py", line 82, in copyfile
    with open(src, 'rb') as fsrc:
IOError: [Errno 2] No such file or directory: u'/Users/ijstokes/anaconda/pkgs/conda-3.18.4-py27_0/bin/activate'
@mcg1969
Copy link
Contributor

mcg1969 commented Jun 28, 2016

Yeah, I'd say it's pretty bad to have conda in your own channel.

That said, since conda 3.3.0, it has been possible to disable automatic updates to conda by adding self_update: false to your .condarc. We've recently deprecated that name to auto_update_conda, and made it settable with conda config (i.e., without having to hand-edit `.condarc').

@mcg1969
Copy link
Contributor

mcg1969 commented Jun 28, 2016

And if you want to disable channel priority altogether, you can do channel_priority: false, and you will get the latest version of a package no matter what channel it comes from. (Ties are still broken by channel priority in that case).

@mcg1969
Copy link
Contributor

mcg1969 commented Jun 28, 2016

If we're going to leave conda auto-updates in the code, I think we should probably make sure it doesn't downgrade. What do you think, @kalefranz?

@ijstokes
Copy link
Author

@mcg1969 thanks for your feedback. The immediate answer is for me to set channel_priority and auto_update to false.

I realize that complexity is a bad thing, so probably the behavior of channel_priority is fine how it is, but just for consideration I feel like if I explicitly list channels and explicitly list packages then I'd like the explicitly listed packages to come from the channels I've given. I realize that the knock-on effect is tricky, though, around dependencies: I can't honestly tell you what behavior I'd expect or consider "preferable"

Is there a command line flag for channel_priority? (I didn't see one).

@mcg1969
Copy link
Contributor

mcg1969 commented Jun 28, 2016

conda config --set channel_priority false will work...

Do check out my PR #2900 and see what you think.

@kalefranz
Copy link
Contributor

@ijstokes The condarc flag is either self_update or auto_update_conda. Officially, from 4.0.9 on, it's auto_update_conda.

@kalefranz
Copy link
Contributor

If we're going to leave conda auto-updates in the code, I think we should probably make sure it doesn't downgrade

I don't think conda should get a special hack. I think if we get finer-grained channel priority right, we won't need it. I think...

@kalefranz
Copy link
Contributor

I feel like if I explicitly list channels and explicitly list packages then I'd like the explicitly listed packages to come from the channels I've given

Yes, we will have finer-grained control over this. And we'll think through thoroughly what user expectations are, and try to make conda "do what I expect it to do" as much as possible. May still take a couple iterations to get right.

@jolespin
Copy link

Will #2900 be a solution to this problem? #5732

@github-actions
Copy link

github-actions bot commented Oct 5, 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 Oct 5, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 5, 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

4 participants