代码之家  ›  专栏  ›  技术社区  ›  Lukasz Tracewski

哪个包裹使康达降低了包裹的等级?

  •  1
  • Lukasz Tracewski  · 技术社区  · 6 年前

    我正在安装一个相当长的软件包列表 conda 使用以下命令:

    conda install -c conda-forge \
        'nomkl' \
        'ipywidgets=7.4.0' \
        'pandas=0.23.4' \
        'numexpr=2.6.5' \
        'matplotlib=2.2.2' \
        'scipy=1.1.0' \
        'seaborn=0.9.0' \
        'scikit-learn=0.19.1' \
        'scikit-image=0.14.0' \
        'sympy=1.2' \
        'cython=0.28.5' \
        'patsy=0.5.0' \
        'statsmodels=0.8.0' \
        'dill=0.2.8.2' \
        'numba=0.38.1' \
        'bokeh=0.13.0' \
        'sqlalchemy=1.2.10' \
        'hdf5' \
        'libnetcdf' \
        'netcdf4' \
        'h5py=2.8.0' \
        'vincent=0.4.4' \
        'beautifulsoup4=4.6.1' \
        'protobuf=3.6.0' \
        'tensorflow=1.10' \
        'opencv' \
        'keras=2.1' \
        'dask=0.19.0' \
        'dask-glm=0.1.0' \
        'dask-ml=0.9.0' \
        'dask-xgboost=0.1.5' \
        'dask-kubernetes=0.5.0' \
        'msgpack-python' \
        'distributed=1.23' \
        'cloudpickle=0.5.3' \
        'python-blosc' \
        'numpy=1.14.2' \
        'xarray=0.10.8' \
        'gcsfs=0.1.2' \
        'pymc3=3.5' \
        'hdbscan=0.8.15' \
        'pystan=2.17.1.0' \
        'yaafe=0.70' \
        'aubio=0.4.6' \
        'librosa=0.6.2' \
        'nltk=3.2.5' \
        'spacy=2.0.11' \
        'gensim=3.5.0' \
        'textblob=0.15.1' \
        'xlrd=1.1.0'  && \
        conda clean -tipsy
    

    作为副作用,会发生以下降级:

    python: 3.6.5-1 conda-forge --> 3.5.5-1
    

    这实际上破坏了我的环境,因为我依赖于python3.6。

    康达

    1 回复  |  直到 6 年前
        1
  •  0
  •   Marcin    6 年前

    尝试从env运行以下脚本。对我来说,它将所有内容都链接到python3.6.6,尽管它在xgboost不可用时失败。你的环境可能会有所不同。只是包装而已 conda create 使用python脚本使其独立于操作系统。它在Windows上用python3.6.6进行了测试。

    from subprocess import run, PIPE, DEVNULL
    import json
    
    deps = ['dask-xgboost=0.1.5', 'nomkl', 'ipywidgets=7.4.0', 'pandas=0.23.4', 'numexpr=2.6.5', 'matplotlib=2.2.2', 'scipy=1.1.0', 'seaborn=0.9.0', 'scikit-learn=0.19.1', 'scikit-image=0.14.0', 'sympy=1.2', 'cython=0.28.5', 'patsy=0.5.0', 'statsmodels=0.8.0', 'dill=0.2.8.2', 'numba=0.38.1', 'bokeh=0.13.0', 'sqlalchemy=1.2.10', 'hdf5', 'libnetcdf', 'netcdf4', 'h5py=2.8.0', 'vincent=0.4.4', 'beautifulsoup4=4.6.1', 'protobuf=3.6.0', 'tensorflow=1.10',     'opencv', 'keras=2.1', 'dask=0.19.0', 'dask-glm=0.1.0', 'dask-ml=0.9.0', 'dask-kubernetes=0.5.0', 'msgpack-python', 'distributed=1.23']
    
    for d in deps:
        links = run('conda create --dry-run --json -n dummy ' + d, stdout=PIPE, stderr=DEVNULL)
        if links.returncode == 0:
            links = json.loads(links.stdout)
            if 'actions' in links:
                links = links['actions']['LINK']
                p = [l for l in links if l['name'] == 'python']
                if len(p): print("{} links python={}".format(d, p[0]['version']))
                else: print("{} - no python".format(d))
            else: print("{} - no actions".format(d))
        else: print("{} failed: {}".format(d, links.stdout.decode('ascii')))
    

    可能更具防御性,但我太懒了,抱歉:)