4

Recently whenever I try and install something through conda I get the following:

Fetching package metadata ...............
Solving package specifications: .

Package plan for installation in environment /Users/askates/anaconda3/envs/fastai:

The following packages will be DOWNGRADED:

    blas:         1.1-openblas                          conda-forge --> 1.0-mkl
    numpy:        1.14.5-py35_blas_openblashd3ea46f_201 conda-forge [blas_openblas] --> 1.14.3-py35h9bb19eb_2
    scikit-learn: 0.19.2-py35_blas_openblas_200         conda-forge [blas_openblas] --> 0.19.1-py35h2b554eb_0
    scipy:        1.1.0-py35_blas_openblashd3ea46f_201  conda-forge [blas_openblas] --> 1.1.0-py35hcaad992_0

If I say yes, and then subsequently try and use numpy I get the following error:

$ python
Python 3.5.5 | packaged by conda-forge | (default, Jul 23 2018, 23:45:11)
[GCC 4.2.1 Compatible Apple LLVM 6.1.0 (clang-602.0.53)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy as np
>>> np.__version__
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'numpy' has no attribute '__version__'

Why is it doing this? I've been getting around it by using the flag --no-deps but that is a poor workaround. It allows to to upgrade back to the (working) openblas numpy but does the same thing again if I try and install something else.

as646
  • 195
  • 1
  • 9

1 Answers1

4

The conda-forge repo uses openblas BLAS implementation and stock Anaconda repo uses Intel's MKL. It looks like in installing your package from conda-forge it required other dependencies to switch to openblas and did not do so successfully. On occasion I have run into situations like this when conda's excellent dependency management does a not-so-excellent job. Usually I resolve it by blowing the environment away and creating a new one from scratch. In this situation I might first try this command from Anaconda to ensure that openblas is installed correctly.

conda install nomkl numpy scipy scikit-learn numexpr

Relavent Anaconda MKL docs: https://docs.continuum.io/mkl-optimizations/

dwagnerkc
  • 488
  • 4
  • 8