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

Support channel prefix in environment.yaml #7202

Closed
1 of 2 tasks
TomAugspurger opened this issue Apr 23, 2018 · 14 comments
Closed
1 of 2 tasks

Support channel prefix in environment.yaml #7202

TomAugspurger opened this issue Apr 23, 2018 · 14 comments
Labels
locked [bot] locked due to inactivity

Comments

@TomAugspurger
Copy link

TomAugspurger commented Apr 23, 2018

I'm submitting a...

  • bug report
  • feature request

It'd be nice if conda env create supported the channel::package syntax in the dependencies list.

Current Behavior

Unclear, but I think that any channels detected as a prefix are pre-pended to the list of channels, and the install proceeds.

Steps to Reproduce

Given this environment.yaml file,

name: test-env
dependencies:
    - python=3.6
    - flask
    - conda-forge::requests

Expected Behavior

I'd expect python and flask to come from the highest priority channel (defaults), and requests to come from conda-forge. It looks like conda-forge was added as the highest priority. I'd further expect that the prefix applies only to requests (and its dependencies?). If I listed another dependency with no channel prefix that's found in conda-forge but not requests, it should error (I think).

$ conda list -n test-env
# packages in environment at /Users/taugspurger/miniconda3/envs/test-env:
#
# Name                    Version                   Build  Channel
asn1crypto                0.24.0                   py36_0    conda-forge
ca-certificates           2018.4.16                     0    conda-forge
certifi                   2018.4.16                py36_0    conda-forge
cffi                      1.11.5                   py36_0    conda-forge
chardet                   3.0.4                    py36_0    conda-forge
click                     6.7                        py_1    conda-forge
cryptography              2.2.1                    py36_0    conda-forge
flask                     0.12.2                   py36_0    conda-forge
idna                      2.6                      py36_1    conda-forge
itsdangerous              0.24                       py_2    conda-forge
jinja2                    2.10                     py36_0    conda-forge
libffi                    3.2.1                         3    conda-forge
markupsafe                1.0                      py36_0    conda-forge
ncurses                   5.9                          10    conda-forge
openssl                   1.0.2o                        0    conda-forge
pip                       9.0.3                    py36_0    conda-forge
pycparser                 2.18                     py36_0    conda-forge
pyopenssl                 17.5.0                   py36_1    conda-forge
pysocks                   1.6.8                    py36_1    conda-forge
python                    3.6.5                         1    conda-forge
readline                  7.0                           0    conda-forge
requests                  2.18.4                   py36_1    conda-forge
setuptools                39.0.1                   py36_0    conda-forge
six                       1.11.0                   py36_1    conda-forge
sqlite                    3.20.1                        2    conda-forge
tk                        8.6.7                         0    conda-forge
urllib3                   1.22                     py36_0    conda-forge
werkzeug                  0.14.1                     py_0    conda-forge
wheel                     0.31.0                   py36_0    conda-forge
xz                        5.2.3                         0    conda-forge
zlib                      1.2.11                        0    conda-forge

Environment Information

`conda info`


     active environment : None
            shell level : 0
       user config file : /Users/taugspurger/.condarc
 populated config files : /Users/taugspurger/.condarc
          conda version : 4.5.1
    conda-build version : 3.4.1
         python version : 3.6.0.final.0
       base environment : /Users/taugspurger/miniconda3  (writable)
           channel URLs : https://repo.anaconda.com/pkgs/main/osx-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/free/osx-64
                          https://repo.anaconda.com/pkgs/free/noarch
                          https://repo.anaconda.com/pkgs/r/osx-64
                          https://repo.anaconda.com/pkgs/r/noarch
                          https://repo.anaconda.com/pkgs/pro/osx-64
                          https://repo.anaconda.com/pkgs/pro/noarch
          package cache : /Users/taugspurger/miniconda3/pkgs
                          /Users/taugspurger/.conda/pkgs
       envs directories : /Users/taugspurger/miniconda3/envs
                          /Users/taugspurger/.conda/envs
               platform : osx-64
             user-agent : conda/4.5.1 requests/2.14.2 CPython/3.6.0 Darwin/17.4.0 OSX/10.13.3
                UID:GID : 502:20
             netrc file : /Users/taugspurger/.netrc
           offline mode : False


`conda config --show-sources`

==> /Users/taugspurger/.condarc <==
channels:
  - defaults
always_yes: True
report_errors: False
anaconda_upload: True

`conda list --show-channel-urls`

# packages in environment at /Users/taugspurger/miniconda3:
#
# Name                    Version                   Build  Channel
alabaster                 0.7.10                   py36_0    conda-forge
anaconda-client           1.6.5            py36h04cfe59_0    defaults
anaconda-project          0.6.0                    py36_0    defaults
apipkg                    1.4                      py36_0    conda-forge
appnope                   0.1.0                    py36_0    conda-forge
argcomplete               1.8.2                    py36_0    conda-forge
astroid                   1.5.3                     <pip>
autoenv                   1.0.0                     <pip>
babel                     2.3.4                    py36_0    conda-forge
bashlex                   0.12                      <pip>
beautifulsoup4            4.5.3                    py36_0    conda-forge
bleach                    1.5.0                    py36_0    conda-forge
ca-certificates           2018.03.07                    0    defaults
certifi                   2018.1.18                py36_0    defaults
cffi                      1.9.1                    py36_0    defaults
chardet                   3.0.2                    py36_1    conda-forge
cibuildwheel              0.6.0                     <pip>
click                     6.7                       <pip>
cloudpickle               0.4.0                     <pip>
clyent                    1.2.1                    py36_0    conda-forge
conda                     4.5.1                    py36_0    defaults
conda-build               3.4.1                    py36_0    defaults
conda-build-all           1.1.1                      py_2    conda-forge
conda-env                 2.6.0                         0    conda-forge
conda-smithy              2.4.4                      py_0    conda-forge
conda-verify              2.0.0                    py36_0    conda-forge
cryptography              1.7.1                    py36_0    defaults
cython                    0.25.2                   py36_1    conda-forge
dask                      0.15.4                    <pip>
dask-glm                  0.1.0                     <pip>
dask-kubernetes           0.2.0                     <pip>
dask-ml                   0.4.2.dev11+gc9856dc           <pip>
dask-searchcv             0.1.0                     <pip>
dbus                      1.10.10                       3    conda-forge
decorator                 4.0.11                   py36_0    conda-forge
distributed               1.19.2                    <pip>
docutils                  0.13.1                   py36_0    conda-forge
elm                       0.2.0+131.g70b2072           <pip>
entrypoints               0.2.2                    py36_1    conda-forge
enum34                    1.1.6                     <pip>
et_xmlfile                1.0.1                    py36_0    conda-forge
execnet                   1.4.1                    py36_0    conda-forge
expat                     2.1.0                         2    conda-forge
fastparquet               0.1.3                     <pip>
filelock                  2.0.6                    py36_0    conda-forge
freetype                  2.7                           1    conda-forge
gitdb                     0.6.4                    py36_1    conda-forge
gitpython                 2.1.1                    py36_0    conda-forge
glob2                     0.5              py36h12393a9_0    defaults
hdf5                      1.10.1               h6090a45_0    defaults
HeapDict                  1.0.0                     <pip>
html5lib                  0.999                    py36_0    conda-forge
icu                       58.1                          1    conda-forge
idna                      2.2                      py36_0    defaults
imagesize                 0.7.1                    py36_0    conda-forge
ipykernel                 4.6.1                    py36_0    conda-forge
ipython                   6.0.0                    py36_0    conda-forge
ipython_genutils          0.2.0                    py36_0    conda-forge
ipywidgets                6.0.0                    py36_0    conda-forge
isort                     4.2.15                    <pip>
jdcal                     1.3                      py36_0    conda-forge
jedi                      0.10.0                   py36_0    conda-forge
jemalloc                  4.4.0                         0    conda-forge
jinja2                    2.9.5                    py36_0    conda-forge
jpeg                      9b                            0    conda-forge
jsonschema                2.5.1                    py36_0    conda-forge
jupyter                   1.0.0                    py36_0    conda-forge
jupyter_client            5.0.1                    py36_0    conda-forge
jupyter_console           5.1.0                    py36_0    conda-forge
jupyter_core              4.3.0                    py36_0    conda-forge
lazy-object-proxy         1.3.1                     <pip>
libcxx                    4.0.1                h579ed51_0    defaults
libcxxabi                 4.0.1                hebd6815_0    defaults
libgcc                    4.8.5               hdbeacc1_10    anaconda
libgfortran               3.0.1                h93005f0_2    defaults
libnvvm                   1.0                          p0    defaults
libpng                    1.6.28                        0    conda-forge
libsodium                 1.0.10                        0    conda-forge
libxgboost                0.60                 h8fd8b8a_0    anaconda
llvmlite                  0.18.0                   py36_0    defaults
markupsafe                0.23                     py36_1    conda-forge
mccabe                    0.6.1                     <pip>
mistune                   0.7.4                    py36_0    conda-forge
mkl                       2017.0.1                      0    defaults
mock                      2.0.0                    py36_0    conda-forge
msgpack-python            0.4.8                     <pip>
multipledispatch          0.4.9                     <pip>
nbconvert                 5.1.1                    py36_1    conda-forge
nbformat                  4.3.0                    py36_0    conda-forge
nbsphinx                  0.2.13                   py36_0    conda-forge
notebook                  5.0.0                    py36_0    conda-forge
numba                     0.33.0              np112py36_0    defaults
numexpr                   2.6.2               np112py36_0    defaults
numpy                     1.12.1                   py36_0    defaults
openpyxl                  2.4.7                    py36_1    conda-forge
openssl                   1.0.2o               h26aff7b_0    defaults
pandas                    0.21.0rc1        py36h713243b_0    pandas
pandoc                    1.19.2                        0    conda-forge
pandocfilters             1.4.1                    py36_0    conda-forge
pbr                       2.1.0                    py36_0    conda-forge
pexpect                   4.2.1                    py36_0    conda-forge
pickleshare               0.7.3                    py36_0    conda-forge
pip                       9.0.1                    py36_1    defaults
pkginfo                   1.2.1                    py36_0    conda-forge
ply                       3.9                      py36_0    conda-forge
prompt_toolkit            1.0.14                   py36_0    conda-forge
protobuf                  3.3.0                    py36_2    conda-forge
psutil                    5.4.0                     <pip>
ptyprocess                0.5.1                    py36_0    conda-forge
py                        1.4.34                   py36_0    conda-forge
py-xgboost                0.60            py36np112hcfb0327_0    anaconda
pyasn1                    0.1.9                    py36_0    defaults
pycosat                   0.6.3            py36hee92d8f_0    defaults
pycparser                 2.17                     py36_0    defaults
pycrypto                  2.6.1                    py36_4    defaults
pygithub                  1.34                     py36_0    conda-forge
pygments                  2.2.0                    py36_0    conda-forge
pyjwt                     1.4.2                    py36_0    conda-forge
pylint                    1.7.4                     <pip>
pyopenssl                 16.2.0                   py36_0    defaults
pyqt                      5.6.0                    py36_2    conda-forge
pytables                  3.4.2            py36h6e7b07d_1    defaults
pytest                    3.1.2                    py36_0    conda-forge
pytest-cache              1.0                      py36_0    conda-forge
python                    3.6.0                         0    defaults
python-dateutil           2.6.0                    py36_0    conda-forge
pytz                      2017.2                   py36_0    conda-forge
pyup                      1.0.0                     <pip>
pyyaml                    3.12                     py36_1    conda-forge
pyzmq                     16.0.2                   py36_2    conda-forge
qt                        5.6.2                         1    conda-forge
qtconsole                 4.3.0                    py36_0    conda-forge
readline                  6.2                           2    defaults
requests                  2.14.2                   py36_0    defaults
requests-toolbelt         0.8.0                     <pip>
ruamel.yaml               0.14.8                   py36_0    conda-forge
ruamel_yaml               0.11.14                  py36_1    defaults
scikit-learn              0.19.0              np112py36_0    anaconda
scikit-learn              0.19.0                    <pip>
scipy                     0.19.1              np112py36_0    anaconda
scipy                     0.19.1                    <pip>
setuptools                36.7.2                    <pip>
setuptools                36.5.0           py36h2134326_0    defaults
simplegeneric             0.8.1                    py36_0    conda-forge
sip                       4.18                     py36_1    conda-forge
six                       1.10.0                   py36_0    defaults
smmap                     2.0.1                    py36_0    conda-forge
snowballstemmer           1.2.1                    py36_0    conda-forge
sortedcontainers          1.5.7                     <pip>
sphinx                    1.6.2                    py36_0    conda-forge
sphinxcontrib             1.0                      py36_0    defaults
sphinxcontrib-websupport  1.0.1                    py36_0    conda-forge
sqlite                    3.13.0                        0    defaults
tblib                     1.3.2                     <pip>
tensorflow                1.1.0                    py36_0    conda-forge
terminado                 0.6                      py36_0    conda-forge
testpath                  0.3                      py36_0    conda-forge
thrift                    0.10.0                    <pip>
thriftpy                  0.3.9                    py36_0    conda-forge
tk                        8.5.18                        0    defaults
toolz                     0.8.2                     <pip>
tornado                   4.5.1                    py36_0    conda-forge
tqdm                      4.19.4                    <pip>
traitlets                 4.3.2                    py36_0    conda-forge
twine                     1.9.1                     <pip>
typing                    3.6.1                    py36_0    conda-forge
virtualenv                15.1.0                    <pip>
virtualfish               1.0.5                     <pip>
wcwidth                   0.1.7                    py36_0    conda-forge
webencodings              0.5                      py36_0    conda-forge
werkzeug                  0.11.10                  py36_0    conda-forge
wheel                     0.29.0                   py36_0    defaults
wheel                     0.30.0                    <pip>
widgetsnbextension        2.0.0                    py36_0    conda-forge
wrapt                     1.10.11                   <pip>
xlrd                      1.0.0                    py36_1    conda-forge
xlsxwriter                0.9.6                    py36_0    conda-forge
xlwt                      1.2.0                    py36_0    defaults
xz                        5.2.2                         1    defaults
yaml                      0.1.6                         0    defaults
zeromq                    4.2.1                         1    conda-forge
zict                      0.1.3                     <pip>
zlib                      1.2.11               h60db283_1    defaults

@TomAugspurger
Copy link
Author

Oh, xref #2800, which was closed. That issue consisted of multiple things, only one of which was supporting the channel::package syntax. The rest were fixed I think.

@kalefranz
Copy link
Contributor

I think this was probably fixed with #7178

@TomAugspurger
Copy link
Author

Oh cool. Is that change in conda canary? If so I can try it out and report back.

@kalefranz
Copy link
Contributor

Yeah, it is. In 4.6.0a1.

@kalefranz
Copy link
Contributor

Def appreciate the testing support!

@TomAugspurger
Copy link
Author

Just tried it out, and things seemed to work perfectly. Thanks!

@pjgoodall
Copy link

Can we put this in the documentation for 'Managing Environments' please

@akapocsi
Copy link

akapocsi commented Apr 7, 2021

Is this behavior/functionality documented anywhere? If so, where?

@drozzy
Copy link

drozzy commented Jun 30, 2021

@akapocsi Nowhere it seems. I didn't even know this feature existed (not sure if it's working yet).
This would be super helpful as strict global channel priority makes some environment files unusuable.

@pjgoodall
Copy link

pjgoodall commented Jul 5, 2021

I had some correspondence, that I can't find from someone associated with anaconda, which said words to the effect that "the feature is supported but not documented"
I use the feature all the time...

@ratnanil
Copy link

the only documentation I've found so far: https://stackoverflow.com/a/47887331/4139249

@danielyan86129
Copy link

Hi @kalefranz how can I specify multiple channels for a pkg, e.g.
conda install cuda -c nvidia/label/cuda-11.3.0 -c nvidia/label/cuda-11.3.1
?

@kenodegard
Copy link
Contributor

@danielyan86129 please open a new issue

@skandermoalla
Copy link

I'd further expect that the prefix applies only to requests (and its dependencies?).

I couldn't find anywhere whether the channel would also apply to the dependencies of the package prefixed with the channel, or if it only applies to the package itself (and its dependencies would be searched in the default channels).
Anyone can help?

@github-actions github-actions bot added the locked [bot] locked due to inactivity label Jun 13, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 13, 2024
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

9 participants