1

I want to install cvxopt in Anaconda Python. Here's the version of my software:

$ python --version
Python 3.6.5 :: Anaconda, Inc.
$ conda --version
conda 4.5.11
$ anaconda --version
anaconda Command line client (version 1.6.14)

I try to install by typing:

conda install cvxopt

I was prompted that about 40 packages will be downloaded, about 10 NEW packages will be installed, the package anaconda will be removed, and about 25 packages will be updated?

  1. Are the NEW packages dependencies?
  2. Why will conda remove the anaconda package? Isn't conda a part of anaconda?

Here is the full output:

Solving environment: done

## Package Plan ##

  environment location: /usr/local/anaconda3

  added / updated specs: 
    - cvxopt


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    suitesparse-5.2.0          |       h171a5a3_0         2.4 MB
    openssl-1.1.1a             |       h7b6447c_0         5.0 MB
    freetype-2.9.1             |       h8a8886c_1         822 KB
    harfbuzz-1.8.8             |       hffaf4a1_0         863 KB
    libssh2-1.8.0              |       h1ba5d50_4         233 KB
    cairo-1.14.12              |       h8948797_3         1.3 MB
    libstdcxx-ng-8.2.0         |       hdf63c60_1         2.9 MB
    conda-4.6.1                |           py36_0         1.7 MB
    glpk-4.65                  |       h3ceedfd_2         1.1 MB
    expat-2.2.6                |       he6710b0_0         187 KB
    krb5-1.16.1                |       h173b8e3_7         1.4 MB
    tbb-2018.0.5               |       h6bb024c_0         1.4 MB
    sqlite-3.26.0              |       h7b6447c_0         1.9 MB
    cvxopt-1.2.0               |   py36h9e0dedd_0         537 KB
    glib-2.56.2                |       hd408876_0         5.0 MB
    python-3.6.8               |       h0371630_0        34.4 MB
    certifi-2018.11.29         |           py36_0         146 KB
    gsl-2.4                    |       h14c3975_4         2.6 MB
    cryptography-2.4.2         |   py36h1ba5d50_0         618 KB
    libuuid-1.0.3              |       h1bed415_2          16 KB
    curl-7.63.0                |    hbc83047_1000         145 KB
    libgcc-ng-8.2.0            |       hdf63c60_1         7.6 MB
    fribidi-1.0.5              |       h7b6447c_0         112 KB
    ca-certificates-2018.12.5  |                0         123 KB
    pango-1.42.3               |       h8589676_0         522 KB
    libpng-1.6.36              |       hbc83047_0         346 KB
    pycurl-7.43.0.2            |   py36h1ba5d50_0         185 KB
    tk-8.6.8                   |       hbc83047_0         3.1 MB
    qt-5.9.7                   |       h5867ecd_1        85.9 MB
    mkl-2018.0.3               |                1       198.7 MB
    libcurl-7.63.0             |    h20c2e04_1000         550 KB
    metis-5.1.0                |       hf484d3e_4         4.1 MB
    fontconfig-2.13.0          |       h9420a91_0         291 KB
    matplotlib-3.0.2           |   py36h5429711_0         6.5 MB
    pillow-5.4.1               |   py36h34e0f95_0         627 KB
    ------------------------------------------------------------
                                           Total:       373.2 MB

The following NEW packages will be INSTALLED:

    cvxopt:          1.2.0-py36h9e0dedd_0   
    fribidi:         1.0.5-h7b6447c_0       
    glpk:            4.65-h3ceedfd_2        
    gsl:             2.4-h14c3975_4         
    krb5:            1.16.1-h173b8e3_7      
    libuuid:         1.0.3-h1bed415_2       
    metis:           5.1.0-hf484d3e_4       
    suitesparse:     5.2.0-h171a5a3_0       
    tbb:             2018.0.5-h6bb024c_0    

The following packages will be REMOVED:

    anaconda:        5.2.0-py36_3           

The following packages will be UPDATED:

    ca-certificates: 2018.03.07-0            --> 2018.12.5-0            
    cairo:           1.14.12-h7636065_2      --> 1.14.12-h8948797_3     
    certifi:         2018.4.16-py36_0        --> 2018.11.29-py36_0      
    conda:           4.5.11-py36_0           --> 4.6.1-py36_0           
    cryptography:    2.2.2-py36h14c3975_0    --> 2.4.2-py36h1ba5d50_0   
    curl:            7.60.0-h84994c4_0       --> 7.63.0-hbc83047_1000   
    expat:           2.2.5-he0dffb1_0        --> 2.2.6-he6710b0_0       
    fontconfig:      2.12.6-h49f89f6_0       --> 2.13.0-h9420a91_0      
    freetype:        2.8-hab7d2ae_1          --> 2.9.1-h8a8886c_1       
    glib:            2.56.1-h000015b_0       --> 2.56.2-hd408876_0      
    harfbuzz:        1.7.6-h5f0a787_1        --> 1.8.8-hffaf4a1_0       
    libcurl:         7.60.0-h1ad7b7a_0       --> 7.63.0-h20c2e04_1000   
    libgcc-ng:       7.2.0-hdf63c60_3        --> 8.2.0-hdf63c60_1       
    libpng:          1.6.34-hb9fc6fc_0       --> 1.6.36-hbc83047_0      
    libssh2:         1.8.0-h9cfc8f7_4        --> 1.8.0-h1ba5d50_4       
    libstdcxx-ng:    7.2.0-hdf63c60_3        --> 8.2.0-hdf63c60_1       
    matplotlib:      2.2.2-py36h0e671d2_1    --> 3.0.2-py36h5429711_0   
    mkl:             2018.0.2-1              --> 2018.0.3-1             
    openssl:         1.0.2o-h20670df_0       --> 1.1.1a-h7b6447c_0      
    pango:           1.41.0-hd475d92_0       --> 1.42.3-h8589676_0      
    pillow:          5.1.0-py36h3deb7b8_0    --> 5.4.1-py36h34e0f95_0   
    pycurl:          7.43.0.1-py36hb7f436b_0 --> 7.43.0.2-py36h1ba5d50_0
    python:          3.6.5-hc3d631a_2        --> 3.6.8-h0371630_0       
    qt:              5.9.5-h7e424d6_0        --> 5.9.7-h5867ecd_1       
    sqlite:          3.23.1-he433501_0       --> 3.26.0-h7b6447c_0      
    tk:              8.6.7-hc745277_3        --> 8.6.8-hbc83047_0       

Proceed ([y]/n)? n


CondaSystemExit: Exiting.
ToniAz
  • 430
  • 1
  • 6
  • 24
  • are you running the conda install after activating the virtual environment? – d_kennetz Jan 28 '19 at 18:41
  • @d_kennetz Since it's the first time I hear of "virtual environment", my answer is probably no. – ToniAz Jan 28 '19 at 18:45
  • prior to running the install, do `source ~/anaconda3/bin/activate`. You will see a little `(base)` in front of your username meaning you are installing inside a venv. Then, try `conda install cvxopt`. I have a good idea of what is going on, but if this does not fix your problem my idea is wrong. – d_kennetz Jan 28 '19 at 18:48

2 Answers2

1

The anaconda package is called a "meta-package" because it does not contain any code itself, but instead specifies dependencies of other packages that should be installed. The package cvoptx is not one of the packages specified by the anaconda package, so if you try to install cvoptx, there is a conflict that conda resolves by removing the anaconda package (since you give cvoptx higher priority by specifying as required to be installed in the environment).

conda and anaconda are separate, and have separate versions. conda is the command line interface that allows you to install, update, and remove packages and environments. anaconda is described above.

Finally (and confusingly), the anaconda command on the command line is provided by the anaconda-client package, not the anaconda package. If you want to see the version of Anaconda that is installed, use conda list anaconda. If you want the version of the anaconda-client command line tool, use anaconda --version. The anaconda-client is used to upload packages and environments to https://anaconda.org

darthbith
  • 18,484
  • 9
  • 60
  • 76
1

The best way is to install it in a separate environment. It is recommended to have different environments for each project. I tend to avoid mixing project requirements together. For the project using cvxopt, I would do:

conda create --name cvx python=3.6

So here I create an environment called cvx that has Python 3.6

This will download all needed packages for Python36. Since it is a clean environment, there would be no upgrading or downgrading.

After that you can activate your environment as:

conda activate cvx

conda install -c conda-forge cvxopt

In these environment you have cvxopt. You can the build your project and run it in these environment. If you need extra packages, you can do:

conda install -n cvxopt PACKAGESNAME

Here is everything you need to know to work with environments https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html

Prayson W. Daniel
  • 14,191
  • 4
  • 51
  • 57