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

Cannot lock when Conda channel_alias is set and nodefaults channel is in environment.yml #192

Closed
janjagusch opened this issue May 11, 2022 · 3 comments · Fixed by #418
Closed

Comments

@janjagusch
Copy link
Contributor

Having a .condarc like this:

channel_alias: example.org

And an environment.yml likes this:

channels:
  - conda-forge
  - nodefaults
packages:
  - ...

Causes the following error when trying to lock the environment:

Generating lockfile(s) for linux-64...
Could not lock the environment for platform linux-64
The channel is not accessible or is invalid.
  channel name: nodefaults
  channel url: example.org/nodefaults
  error code: 404

You can resolve the issue by adding the following to your .condarc:

custom_channels:
  nodefaults: https://conda.anaconda.org

However, I wouldn't expect this to be necessary, as nodefaults is not an actual channel. It is only supposed to indicate that no default channels should be used.

I've tried this on conda-lock 0.13.2 and 1.0.5. My conda/mamba version is:

mamba 0.23.0
conda 4.12.0

It is important to mention that you can mamba env create the environment. So the issue seems to lie within conda-lock.

Any idea what might be causing this?

@mariusvniekerk
Copy link
Collaborator

Given that conda-lock already makes use of --override-channels aggressively you probably shouldn't need to use nodefaults. We can probably just filter this channel out at parse time of the environment.yaml

@mariusvniekerk
Copy link
Collaborator

Ultimately all that conda-lock does when it sees that is call

mamba create --override-channels -c conda-forge -c nodefaults -n test12456 --dry-run --json ...

@janjagusch
Copy link
Contributor Author

Given that conda-lock already makes use of --override-channels aggressively you probably shouldn't need to use nodefaults. We can probably just filter this channel out at parse time of the environment.yaml

Thanks for the information @mariusvniekerk. If possible, I would prefer to leave the nodefaults channel inside of my environment file to ensure that locking the environment behaves identically to installing it.

Omitting the nodefaults channel at parse time seems like a good option to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants