Numpy package installed twice in single Anaconda e

2019-07-29 01:40发布

问题:

I just used pip to install Silx in an existing Anaconda environment (called gssw). Pip then started to install Numpy (one of the dependencies of Silx) even though my environment already contained an older version of Numpy that was installed as a regular conda package. To my understanding this should not happen!

I now have two numpy packages in my enviromnent.

(gssw) C:\>conda list numpy
# packages in environment at C:\Anaconda\envs\gssw:
#
numpy                     1.11.2                   py35_0
numpy                     1.15.0                    <pip>

When start Python it seems to use the latter.

(gssw) C:\>python -c "import numpy; print(numpy.__version__)"
1.15.0

Here is my conda info

(gssw) C:\>conda info
Current conda install:

               platform : win-64
          conda version : 4.3.30
       conda is private : False
      conda-env version : 4.3.30
    conda-build version : 1.11.0
         python version : 2.7.9.final.0
       requests version : 2.12.4
       root environment : C:\Anaconda  (writable)
    default environment : C:\Anaconda\envs\gssw
       envs directories : C:\Anaconda\envs
                          C:\Users\kenter\AppData\Local\conda\conda\envs
                          C:\Users\kenter\.conda\envs
          package cache : C:\Anaconda\pkgs
                          C:\Users\kenter\AppData\Local\conda\conda\pkgs
           channel URLs : https://repo.continuum.io/pkgs/main/win-64
                          https://repo.continuum.io/pkgs/main/noarch
                          https://repo.continuum.io/pkgs/free/win-64
                          https://repo.continuum.io/pkgs/free/noarch
                          https://repo.continuum.io/pkgs/r/win-64
                          https://repo.continuum.io/pkgs/r/noarch
                          https://repo.continuum.io/pkgs/pro/win-64
                          https://repo.continuum.io/pkgs/pro/noarch
                          https://repo.continuum.io/pkgs/msys2/win-64
                          https://repo.continuum.io/pkgs/msys2/noarch
            config file : None
             netrc file : None
           offline mode : False
             user-agent : conda/4.3.30 requests/2.12.4 CPython/2.7.9 Windows/7 Windows/6.1.7601
          administrator : False

So my questions are...

  1. I assumed that it is impossible to have two packages with the same name in one enviroment. Is that correct or do I misunderstand how Anaconda works?

  2. What went wrong here?

  3. How to fix it?

Please let me know if you need anymore info.