update or install in one command?

0 views
Skip to first unread message

Jacob Vanderplas

unread,
May 15, 2018, 5:28:46 PM5/15/18
to conda
Hi all,
Is there any single conda command that will update a package if it exists, or install the package if it doesn't?

I'm thinking of a conda equivalent to ``pip install -U package``

Having such a command would simplify installation instructions in situations where the user might have an older version of the package already around.

I understand that ``conda install`` followed by ``conda update`` would work for all users, but in my experience every extra step in installation instructions roughly doubles the number of users who will contact the mailing list with installation issues. A single install + update command like the one pip provides would be very useful.

Thanks,
    Jake

 Jake VanderPlas
 Senior Data Science Fellow
 Director of Open Software
 University of Washington eScience Institute

James E.H. Turner

unread,
May 15, 2018, 5:33:24 PM5/15/18
to co...@continuum.io
Hi Jake,

Doesn't ``conda install`` (again) do what you want? Just a suggestion if
you hadn't tried it, since I spotted this in passing.

Cheers,

James.
> --
> You received this message because you are subscribed to the Google Groups "conda
> - Public" group.
> To unsubscribe from this group and stop receiving emails from it, send an email
> to conda+un...@continuum.io <mailto:conda+un...@continuum.io>.
> To post to this group, send email to co...@continuum.io <mailto:co...@continuum.io>.
> Visit this group at https://groups.google.com/a/continuum.io/group/conda/.
> To view this discussion on the web visit
> https://groups.google.com/a/continuum.io/d/msgid/conda/CACpqBg0k2TC9ZHZ3wNth39ym9bBoUp_-Gn8g9CN7rmE8fN%2BQHg%40mail.gmail.com
> <https://groups.google.com/a/continuum.io/d/msgid/conda/CACpqBg0k2TC9ZHZ3wNth39ym9bBoUp_-Gn8g9CN7rmE8fN%2BQHg%40mail.gmail.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Michael Sarahan

unread,
May 15, 2018, 5:35:24 PM5/15/18
to James E.H. Turner, conda - Public
Yes, I think James is right:

conda create -n update_test python=3.6.0
Solving environment: done

## Package Plan ##

  environment location: /Users/msarahan/miniconda3/envs/update_test

  added / updated specs:
    - python=3.6.0


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    python-3.6.0               |                0        11.7 MB

The following NEW packages will be INSTALLED:

    ca-certificates: 2018.03.07-0
    certifi:         2018.4.16-py36_0
    openssl:         1.0.2o-h26aff7b_0
    pip:             10.0.1-py36_0
    python:          3.6.0-0
    readline:        6.2-2
    setuptools:      39.1.0-py36_0
    sqlite:          3.13.0-0
    tk:              8.5.18-0
    wheel:           0.31.1-py36_0
    xz:              5.2.3-h727817e_4
    zlib:            1.2.11-hf3cbc9b_2

Proceed ([y]/n)?


Downloading and Extracting Packages
python 3.6.0################################################################################################ | 100%
Preparing transaction: done
Executing transaction: done
#
# To activate this environment, use:
# > source activate update_test
#
# To deactivate an active environment, use:
# > source deactivate
#

 msarahan@0109-msarahan-2  ~/code/aggregate   master ●✚  conda install -n update_test python pillow
Solving environment: done

## Package Plan ##

  environment location: /Users/msarahan/miniconda3/envs/update_test

  added / updated specs:
    - pillow
    - python


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    pillow-5.1.0               |   py36hfcce615_0         542 KB

The following NEW packages will be INSTALLED:

    freetype:  2.8-h12048fb_1
    jpeg:      9b-he5867d9_2
    libcxx:    4.0.1-h579ed51_0
    libcxxabi: 4.0.1-hebd6815_0
    libedit:   3.1.20170329-hb402a30_2
    libffi:    3.2.1-h475c297_4
    libpng:    1.6.34-he12f830_0
    libtiff:   4.0.9-hcb84e12_1
    ncurses:   6.1-h0a44026_0
    olefile:   0.45.1-py36_0
    pillow:    5.1.0-py36hfcce615_0

The following packages will be UPDATED:

    python:    3.6.0-0                 --> 3.6.5-hc167b69_1
    readline:  6.2-2                   --> 7.0-hc1231fa_4
    sqlite:    3.13.0-0                --> 3.23.1-hf1716c9_0
    tk:        8.5.18-0                --> 8.6.7-h35a86e2_3

On Tue, May 15, 2018 at 4:33 PM, James E.H. Turner <jeht...@gmail.com> wrote:
Hi Jake,

Doesn't ``conda install`` (again) do what you want? Just a suggestion if
you hadn't tried it, since I spotted this in passing.

Cheers,

James.


On 15/05/18 17:28, Jacob Vanderplas wrote:
Hi all,
Is there any single conda command that will update a package if it exists, or install the package if it doesn't?

I'm thinking of a conda equivalent to ``pip install -U package``

Having such a command would simplify installation instructions in situations where the user might have an older version of the package already around.

I understand that ``conda install`` followed by ``conda update`` would work for all users, but in my experience every extra step in installation instructions roughly doubles the number of users who will contact the mailing list with installation issues. A single install + update command like the one pip provides would be very useful.

Thanks,
     Jake

Jake VanderPlas
  Senior Data Science Fellow
  Director of Open Software
University of Washington eScience Institute

--
You received this message because you are subscribed to the Google Groups "conda - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to conda+un...@continuum.io <mailto:conda+unsubscribe@continuum.io>.
--
You received this message because you are subscribed to the Google Groups "conda - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to conda+un...@continuum.io.
To post to this group, send email to co...@continuum.io.

Ariel Balter

unread,
May 15, 2018, 6:29:56 PM5/15/18
to conda - Public
In the mean time,

conda update --all -y && conda install XXXX -y

You could make an alias.
Reply all
Reply to author
Forward
0 new messages